*, *::before, *::after {
  box-sizing: border-box;
}

/* Support Issues */
.support-hub {
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.support-hub-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.support-hub-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.support-updates-panel {
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-elevated, #fff);
  border: 1.25px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.support-updates-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.support-updates-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.support-updates-header .small-text {
  margin-top: var(--space-1);
  max-width: 76ch;
}

.support-updates-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}

.support-update-group {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 252, 0.72);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.support-update-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.support-update-group-head h4 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-heading);
}

.support-update-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}

.support-update-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-md);
  background: #fff;
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.support-update-card-title {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--color-heading);
}

.support-update-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.support-update-card-summary {
  margin: 0;
  color: var(--color-text);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.support-update-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.support-feature-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 var(--space-2);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.support-feature-status.is-released {
  border-color: rgba(34, 197, 94, 0.34);
  color: #15803d;
}

.support-feature-status.is-in_progress {
  border-color: rgba(245, 158, 11, 0.34);
  color: #b45309;
}

.support-feature-status.is-planned {
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
}

.support-update-empty {
  margin: 0;
}

.support-update-create-dialog {
  width: min(760px, 96vw);
}

.support-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2);
  border-radius: var(--radius-xl);
  background: var(--surface-elevated, #fff);
  border: 1.25px solid rgba(15, 23, 42, 0.08);
}

.support-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 280px;
}

.support-search .search-input {
  flex: 1 1 240px;
  min-width: 220px;
}

.support-scope-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface-subtle);
  min-height: 40px;
  cursor: pointer;
  white-space: nowrap;
}

.support-scope-toggle span {
  font-size: 0.85rem;
}

.support-table-panel {
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated, #fff);
  border: 1.25px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.support-table-panel .table-container {
  border-radius: var(--radius-md);
  box-shadow: none;
}

.support-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.support-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface-subtle);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1.25px solid var(--color-border);
  white-space: nowrap;
}

.support-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1.25px solid var(--color-border);
  vertical-align: middle;
  word-break: break-word;
  background: transparent;
}

.support-table tbody tr:hover {
  background: var(--color-neutral-soft);
}

.support-table tbody tr:last-child td {
  border-bottom: none;
}

.support-table th:nth-child(2),
.support-table td:nth-child(2),
.support-table th:nth-child(4),
.support-table td:nth-child(4) {
  text-align: center;
  white-space: nowrap;
}

.support-table th:last-child,
.support-table td:last-child {
  text-align: right;
}

.support-table .support-title-cell {
  font-weight: 600;
  color: var(--color-heading);
}

.support-table .support-title-sub {
  margin-top: var(--space-1);
  font-size: 0.85rem;
  color: var(--color-muted);
}

.support-table-meta {
  margin-top: 0;
  padding: 0 var(--space-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.support-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-3);
  height: 26px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  color: #334155;
}

.support-status-badge.is-new {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #1d4ed8;
}

.support-status-badge.is-triaged {
  border-color: rgba(14, 165, 233, 0.3);
  color: #0369a1;
}

.support-status-badge.is-in_progress {
  border-color: rgba(245, 158, 11, 0.35);
  color: #b45309;
}

.support-status-badge.is-need_user {
  border-color: rgba(248, 113, 113, 0.35);
  color: #b91c1c;
}

.support-status-badge.is-resolved {
  border-color: rgba(34, 197, 94, 0.35);
  color: #15803d;
}

.support-status-badge.is-closed,
.support-status-badge.is-rejected {
  border-color: rgba(148, 163, 184, 0.4);
  color: #475569;
}

.support-warning {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #334155;
  margin-bottom: var(--space-4);
  font-size: 0.82rem;
}

.support-warning--compact {
  margin-bottom: 0;
}

.support-create-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.support-create-subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.84rem;
  line-height: 1.35;
  max-width: 70ch;
}

.support-create-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.support-create-section {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: var(--surface-elevated, #fff);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.support-create-section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.support-create-section-head h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-heading);
}

.support-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.support-form-grid--create {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.support-create-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

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

.support-create-field label {
  font-size: 0.84rem;
  font-weight: var(--font-weight-semibold, 600);
  color: var(--color-heading);
}

.support-create-field input,
.support-create-field select,
.support-create-field textarea {
  width: 100%;
}

.support-create-field textarea {
  resize: vertical;
  min-height: 92px;
}

.support-create-meta-note {
  margin: 0;
}

.support-create-upload-button {
  display: inline-flex;
  align-items: center;
}

.support-create-attachments-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 24px;
}

.support-create-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.9);
}

.support-create-attachment-main {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.support-create-attachment-thumb,
.support-create-attachment-thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  flex: 0 0 52px;
}

.support-create-attachment-thumb {
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
}

.support-create-attachment-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: var(--font-weight-semibold, 600);
  color: #475569;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: rgba(248, 250, 252, 0.95);
}

.support-create-attachment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.support-create-attachment-meta strong {
  font-size: 0.86rem;
  color: var(--color-heading);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.support-form-group {
  margin-top: var(--space-3);
}

.support-modal-dialog {
  width: min(900px, 96vw);
}

.support-create-dialog {
  width: min(940px, 96vw);
}

.support-detail-dialog {
  width: min(1080px, 96vw);
}

.support-detail-modal-header {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.9),
    rgba(241, 245, 249, 0.75)
  );
}

.support-detail-status-chip {
  min-width: 0;
  justify-content: center;
  margin-top: 0;
}

.support-create-dialog .modal-actions {
  padding-top: var(--space-2);
}

.support-create-modal-actions {
  justify-content: flex-end;
}

.support-create-cancel-button {
  margin-right: 0;
}

@media (max-width: 780px) {
  .support-updates-header {
    flex-direction: column;
    align-items: stretch;
  }

  .support-updates-header #supportUpdateCreateButton {
    width: 100%;
    justify-content: center;
  }

  .support-updates-board {
    grid-template-columns: 1fr;
  }

  .support-search {
    flex: 1 1 100%;
  }

  .support-search .search-input {
    min-width: 0;
    flex: 1 1 100%;
  }

  .support-scope-toggle {
    margin-left: 0;
  }

  .support-create-subtitle {
    max-width: 100%;
  }

  .support-create-section {
    padding: var(--space-2);
  }

  .support-form-grid--create {
    grid-template-columns: 1fr;
  }

  .support-create-attachment-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .support-create-attachment-main {
    width: 100%;
  }

  .support-create-modal-actions {
    justify-content: stretch;
  }

  .support-create-cancel-button {
    margin-right: 0;
  }

  .support-create-modal-actions .support-create-upload-button,
  .support-create-modal-actions #supportCreateSubmit,
  .support-create-modal-actions .support-create-cancel-button {
    width: 100%;
    justify-content: center;
  }
}

.support-detail-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.support-detail-title-block {
  gap: var(--space-1);
}

.support-detail-title-block h3 {
  margin: 0;
}

.support-detail-type-badge {
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.12);
}

.support-detail-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.support-detail-header-actions.modal-header-actions {
  align-self: flex-start;
  gap: var(--space-2);
}

.support-status-control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.support-status-control-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold, 600);
  color: var(--color-muted);
  white-space: nowrap;
}

.support-status-select {
  width: auto;
  min-width: 168px;
  max-width: 220px;
  padding: var(--space-2) calc(var(--space-3) * 2) var(--space-2) var(--space-3);
  border-radius: 999px;
  border-color: rgba(148, 163, 184, 0.45);
  background-color: #fff;
  font-size: 0.84rem;
  line-height: 1.2;
}

.support-detail-dialog .modal-body {
  padding-right: var(--space-1);
}

#supportDetailNotice {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.support-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.support-detail-side-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.support-detail-section {
  margin-top: 0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-md);
  background: var(--surface-elevated, #fff);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.support-detail-section--timeline {
  min-height: 460px;
}

.support-detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.support-detail-section-header--timeline {
  align-items: center;
}

.support-detail-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: 0;
}

.support-context-card {
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.85rem;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}

.support-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 64vh;
  overflow-y: auto;
  padding-left: 14px;
  padding-right: var(--space-1);
}

.support-timeline-item {
  position: relative;
  padding: var(--space-2) 0 var(--space-2) var(--space-4);
  border-left: 2px solid rgba(148, 163, 184, 0.32);
}

.support-timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.support-timeline-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--color-muted);
}

.support-timeline-body {
  margin-top: var(--space-2);
  color: var(--color-heading);
}

.support-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}

.support-attachment-card {
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.support-attachment-actions {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (max-width: 720px) {
  .support-attachment-actions button {
    width: 100%;
    justify-content: center;
  }
}

.support-detail-comment-composer {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.support-detail-comment-composer textarea {
  min-height: 96px;
}

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

  .support-detail-section--timeline {
    min-height: 0;
  }

  .support-detail-section-header--timeline {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .support-status-control {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .support-status-select {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .support-timeline {
    max-height: none;
  }
}

.app-version-badge {
  position: fixed;
  bottom: 12px;
  right: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted, #6b7280);
  background: rgba(255, 255, 255, 0.92);
  border: 1.25px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  pointer-events: none;
  z-index: 40;
}

html {
  font-size: 16px;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background:
    radial-gradient(1200px 1200px at 8% 12%, rgba(37, 99, 235, 0.16), transparent 55%),
    radial-gradient(1400px 1000px at 92% 18%, rgba(14, 165, 233, 0.18), transparent 55%),
    linear-gradient(140deg, #eef2ff 0%, #f8fafc 40%, #ffffff 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body.app-logged-in {
  justify-content: flex-start;
}

body > * {
  width: 100%;
}

h1, h2, h3, h4 {
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

h2 {
  padding-left: 12px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

h3 {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
}

h4 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

p {
  margin: 0 0 var(--space-1);
}

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

.text-center {
  text-align: center;
}

.page-lead {
  font-size: 1.05rem;
  max-width: 52ch;
}

.app-wrapper {
  width: min(100%, 1500px);
  margin: var(--space-2) auto var(--space-10);
  padding-top: var(--space-4);
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  padding-bottom: var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-xxl);
  border: 1.25px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: relative;
  transition: width var(--transition-base);
}

.app-wrapper--full {
  width: min(100%, calc(100vw - var(--space-6)));
  max-width: none;
}

.app-wrapper.logged-in {
  gap: var(--space-4);
}

body {
  --routing-panel-width: 380px;
  --weight-panel-width: 380px;
}

body.with-routing-panel .app-wrapper {
  max-width: min(1500px, calc(100vw - var(--routing-panel-width) - var(--space-6)));
  width: min(100%, calc(100vw - var(--routing-panel-width) - var(--space-6)));
  margin-left: var(--space-4);
  margin-right: calc(var(--routing-panel-width) + var(--space-4));
}

body.with-chat-dock-panel {
  --chat-dock-pinned-width: min(420px, 36vw);
}

body.with-chat-dock-panel .app-wrapper {
  max-width: min(1500px, calc(100vw - var(--chat-dock-pinned-width) - var(--space-6)));
  width: min(100%, calc(100vw - var(--chat-dock-pinned-width) - var(--space-6)));
  margin-left: var(--space-4);
  margin-right: calc(var(--chat-dock-pinned-width) + var(--space-4));
}

body.with-weight-panel .app-wrapper {
  max-width: min(1500px, calc(100vw - var(--weight-panel-width) - var(--space-6)));
  width: min(100%, calc(100vw - var(--weight-panel-width) - var(--space-6)));
  margin-left: var(--space-4);
  margin-right: calc(var(--weight-panel-width) + var(--space-4));
}

body.with-routing-panel.with-weight-panel .app-wrapper {
  max-width: min(
    1500px,
    calc(100vw - var(--routing-panel-width) - var(--weight-panel-width) - var(--space-6))
  );
  width: min(
    100%,
    calc(100vw - var(--routing-panel-width) - var(--weight-panel-width) - var(--space-6))
  );
  margin-left: var(--space-4);
  margin-right: calc(var(--routing-panel-width) + var(--weight-panel-width) + var(--space-5));
}

body.with-chat-dock-panel.with-routing-panel .app-wrapper {
  max-width: min(
    1500px,
    calc(100vw - var(--routing-panel-width) - var(--chat-dock-pinned-width) - var(--space-6))
  );
  width: min(
    100%,
    calc(100vw - var(--routing-panel-width) - var(--chat-dock-pinned-width) - var(--space-6))
  );
  margin-left: var(--space-4);
  margin-right: calc(var(--routing-panel-width) + var(--chat-dock-pinned-width) + var(--space-4));
}

body.with-chat-dock-panel.with-weight-panel .app-wrapper {
  max-width: min(
    1500px,
    calc(100vw - var(--weight-panel-width) - var(--chat-dock-pinned-width) - var(--space-6))
  );
  width: min(
    100%,
    calc(100vw - var(--weight-panel-width) - var(--chat-dock-pinned-width) - var(--space-6))
  );
  margin-left: var(--space-4);
  margin-right: calc(var(--weight-panel-width) + var(--chat-dock-pinned-width) + var(--space-4));
}

body.with-chat-dock-panel.with-routing-panel.with-weight-panel .app-wrapper {
  max-width: min(
    1500px,
    calc(
      100vw - var(--routing-panel-width) - var(--weight-panel-width) - var(--chat-dock-pinned-width) - var(--space-6)
    )
  );
  width: min(
    100%,
    calc(
      100vw - var(--routing-panel-width) - var(--weight-panel-width) - var(--chat-dock-pinned-width) - var(--space-6)
    )
  );
  margin-left: var(--space-4);
  margin-right: calc(
    var(--routing-panel-width) + var(--weight-panel-width) + var(--chat-dock-pinned-width) + var(--space-5)
  );
}

.app-wrapper.logged-out {
  margin: clamp(16px, 3vh, 32px) auto clamp(24px, 8vh, 72px);
  background: transparent;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
  border: 1.25px solid rgba(226, 232, 240, 0.8);
  padding: clamp(24px, 3vh, 36px) clamp(24px, 6vw, 56px) clamp(36px, 5vh, 48px);
  gap: clamp(20px, 3vh, 32px);
  backdrop-filter: blur(6px);
  position: relative;
}

.app-watermark {
  position: absolute;
  left: clamp(24px, 6vw, 56px);
  bottom: clamp(16px, 3vh, 32px);
  height: 48px;
  width: auto;
  opacity: 0.9;
  pointer-events: none;
}

.app-wrapper.logged-in .app-watermark {
  display: none;
}
.app-wrapper.logged-out .tab-menu-toggle,
.app-wrapper.logged-out .tab-nav {
  display: none !important;
}

.routing-panel {
  position: fixed;
  top: var(--space-6);
  right: var(--space-4);
  bottom: var(--space-6);
  width: var(--routing-panel-width);
  min-width: 320px;
  max-width: 640px;
  background: linear-gradient(160deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.92));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}

body.with-weight-panel .routing-panel {
  right: calc(var(--weight-panel-width) + var(--space-4));
}

.routing-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at 0% 0%,
      rgba(37, 99, 235, 0.08),
      transparent 52%
    ),
    radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.08), transparent 48%);
  pointer-events: none;
}

.routing-panel[hidden] {
  display: none !important;
}

.routing-panel-header {
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  z-index: 1;
}

.routing-panel-title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.routing-panel-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.routing-panel-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0 var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1;
}

.routing-panel-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  color: var(--color-heading);
  background: rgba(148, 163, 184, 0.15);
}

.routing-panel-chip[data-tone="accent"] {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.25);
  color: rgba(30, 64, 175, 0.9);
}

.routing-panel-chip[data-tone="neutral"] {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.32);
  color: rgba(30, 41, 59, 0.88);
}

.routing-panel-chip[data-tone="success"] {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.26);
  color: rgba(22, 101, 52, 0.92);
}

.routing-panel-chip[data-tone="muted"] {
  background: rgba(226, 232, 240, 0.8);
  border-color: rgba(203, 213, 225, 0.7);
  color: rgba(71, 85, 105, 0.9);
}

.routing-panel-body {
  padding: var(--space-2) var(--space-3) var(--space-3);
  overflow-y: auto;
  flex: 1 1 auto;
}

.routing-panel .import-routing-chart-table {
  font-size: 0.85rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  background: rgba(255, 255, 255, 0.7);
}

.routing-panel .import-routing-chart-table th {
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(4px);
}

.routing-panel .import-routing-chart-table tbody tr:nth-child(even) td {
  background: rgba(148, 163, 184, 0.08);
}

.routing-panel .import-routing-chart-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.12);
}

.routing-panel-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.routing-panel-resize-handle::after {
  content: "";
  position: absolute;
  top: 15%;
  left: 4px;
  width: 2px;
  height: 70%;
  border-radius: var(--radius-pill);
  background: var(--color-border-subtle);
  opacity: 0.6;
}

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

.app-wrapper.logged-in .landing-header .page-lead {
  display: none;
}

body.app-logged-in .app-wrapper {
  background: var(--color-surface);
}

.landing-header {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  text-align: left;
  max-width: 100%;
  margin: 0 0 var(--space-6) 0;
  flex-wrap: nowrap;
}

.landing-logo {
  height: clamp(36px, 7vw, 72px);
  width: auto;
  object-fit: contain;
}

.landing-logo2 {
  height: clamp(8px, 7vw, 16px);
  width: auto;
  object-fit: contain;
}


.landing-logo + .landing-logo {
  margin-left: var(--space-3);
}

.landing-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.app-wrapper.logged-out .landing-copy {
  flex-direction: row;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: nowrap;
}

.app-wrapper.logged-out .landing-copy .landing-title,
.app-wrapper.logged-out .landing-copy .page-lead {
  margin: 0;
  white-space: nowrap;
}

.landing-header h1 {
  color: #0f172a;
}

.app-wrapper.logged-in .landing-header {
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  margin: 0 0 0 auto;
}

.app-wrapper.logged-in .landing-title {
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  margin: 0;
}

.app-wrapper.logged-in .landing-footer {
  display: none;
}

.app-wrapper.logged-in .landing-logo {
  display: none;
}

.app-wrapper.logged-in .landing-logo2 {
  display: none;
}



.app-wrapper.logged-out .landing-header {
  justify-content: flex-start;
}

.app-wrapper.logged-out .landing-header h1 {
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  margin: 0;
  letter-spacing: -0.02em;
}

@media (max-width: 768px) {
  .landing-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .landing-footer .landing-copy {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    flex-wrap: wrap;
  }

  .landing-footer .page-lead {
    min-width: auto;
    max-width: 100%;
  }
}

.landing-footer {
  margin-top: auto;
  padding-top: var(--space-5);
}

.landing-footer .landing-copy {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: var(--space-4);
  flex-wrap: nowrap;
}

.landing-footer .landing-title {
  font-size: clamp(1.4rem, 10vw, 4.4rem);
  margin: 0;
  letter-spacing: -0.02em;
  color: #0f172a;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
}

.landing-footer .page-lead {
  min-width: 44ch;
  max-width: 52ch;
  font-size: 1rem;
  line-height: 1.45;
  margin: 0;
  color: var(--color-text-muted);
  text-align: justify;
  text-align-last: left;
  text-wrap: balance;
  display: block;
}


.login-panel {
  width: min(100%, 440px);
  margin: 96px auto 0;
  padding: var(--space-7) var(--space-6);
  border-radius: var(--radius-xxl);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.9));
  border: 1.25px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: -30% 50% auto -40%;
  height: 220px;
  opacity: 0.9;
  pointer-events: none;
}

.login-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -45% -10%;
  background: radial-gradient(circle at 50% 30%, rgba(14, 165, 233, 0.16), transparent 70%);
  pointer-events: none;
}

.login-panel > * {
  position: relative;
  z-index: 1;
}

.login-panel:focus-within {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.login-form-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto var(--space-2);
  margin-bottom: 16px;
  margin-top: 16px;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.18));
}

.app-wrapper.logged-in .login-form-logo {
  display: none;
}

.login-form {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  gap: var(--space-5);
}
.login-actions {
  margin-top: var(--space-4);
}

.login-form label {
  font-weight: var(--font-weight-semibold);
}

.login-form input {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
}

#loginControls {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-password-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.login-qr-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
}

.login-qr-header {
  display: flex;
  text-align: center;
  flex-direction: column;
  gap: var(--space-2);
}

.login-qr-config,
.login-qr-session {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.login-qr-session {
  align-items: center;
  text-align: center;
}

.login-qr-card {
  position: relative;
}

.login-qr-code {
  width: 250px;
  height: 250px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  position: relative;
}

.login-qr-countdown {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.02em;
  z-index: 1;
}

body.qr-verify-mode .app-wrapper > * {
  display: none !important;
}

body.qr-verify-mode #qrVerifyPanel {
  display: block !important;
}

html.qr-verify-mode body .app-wrapper > * {
  display: none !important;
}

html.qr-verify-mode body #qrVerifyPanel {
  display: block !important;
}

html.qr-verify-mode body #appFlashScreen {
  display: none !important;
}

.qr-verify-panel {
  width: min(100%, 760px);
  margin: clamp(24px, 6vh, 72px) auto 0;
  display: flex;
  flex-direction: column;
}

.qr-verify-card {
  padding: var(--space-6);
  border-radius: var(--radius-xxl);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.9));
  border: 1.25px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.qr-verify-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.qr-verify-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.qr-verify-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.qr-verify-heading {
  margin: 0;
  font-size: 1.4rem;
}

.qr-verify-subtitle {
  margin: 0;
}

.qr-verify-status {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.18);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.qr-verify-status.is-success {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.qr-verify-status.is-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.qr-verify-status.is-error {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.qr-verify-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.qr-verify-meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: rgba(15, 23, 42, 0.04);
  border-radius: var(--radius-lg);
}

.qr-verify-meta-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.qr-verify-meta-value {
  font-weight: var(--font-weight-semibold);
  word-break: break-word;
}

.qr-verify-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.qr-verify-help {
  margin: 0;
}

@media (max-width: 720px) {
  .qr-verify-card {
    padding: var(--space-5);
  }

  .qr-verify-meta {
    grid-template-columns: 1fr;
  }
}

.login-qr-code canvas,
.login-qr-code img {
  width: 220px;
  height: 220px;
}

.login-qr-code.is-expired {
  cursor: pointer;
}

.login-qr-code.is-expired > canvas,
.login-qr-code.is-expired > img {
  filter: grayscale(0.2) opacity(0.55);
}

.login-qr-recreate {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  padding: 0;
  line-height: 0;
  border-radius: 999px;
  border: 1.25px solid rgba(37, 99, 235, 0.25);
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
}

.login-qr-recreate img {
  width: 32px;
  height: 32px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-qr-status-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.login-qr-status {
  font-size: 0.95rem;
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

.login-qr-copy {
  padding: 0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-qr-copy.ghost-button {
  padding: 0;
  line-height: 0;
}

.login-qr-copy svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.login-qr-session-id {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.login-qr-back {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.9rem;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.qr-approve-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.qr-approve-scan {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
}

.qr-approve-video-frame {
  position: relative;
  width: min(320px, 80vw);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.qr-approve-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-approve-scan-overlay {
  position: absolute;
  inset: 12%;
  border-radius: var(--radius-md);
  border: 2px dashed rgba(37, 99, 235, 0.6);
  pointer-events: none;
}

.qr-approve-manual {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.qr-approve-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: rgba(248, 250, 252, 0.7);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.qr-approve-info.qr-approve-summary {
  background: transparent;
  border: none;
  padding: 0;
}

.qr-approve-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-2);
  align-items: center;
}

.qr-approve-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.qr-approve-value {
  font-size: 0.9rem;
  color: var(--color-text);
  word-break: break-word;
}

.qr-approve-confirm {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9rem;
  color: var(--color-text);
}

.qr-approve-duration {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.qr-approve-duration-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.qr-approve-quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.qr-approve-chip {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: var(--font-weight-medium);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.qr-approve-chip.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}

.qr-approve-actions {
  flex-direction: column;
  align-items: stretch;
  background: transparent;
  position: static;
  margin-top: var(--space-4);
}

.qr-approve-actions button {
  width: 100%;
}

@media (max-width: 640px) {
  .login-panel {
    margin: 36px auto 0;
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-xl);
  }

  .login-form-logo {
    height: 40px;
    margin-top: 8px;
    margin-bottom: 12px;
  }

  .login-actions {
    flex-direction: column;
  }

  .login-actions button {
    width: 100%;
    min-width: 0;
  }

  .login-actions .login-qr-toggle {
    width: 44px;
    min-width: 44px;
    align-self: flex-end;
  }

  .login-qr-row {
    grid-template-columns: 88px 1fr;
  }
  .login-qr-row .ghost-button {
    justify-self: start;
  }
  .qr-approve-row {
    grid-template-columns: 1fr;
  }
}
.auth-badge {
  align-self: flex-start;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  border: 1.25px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.auth-badge.logged-in {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: stretch;
}

.login-actions button {
  flex: 1;
  min-width: 140px;
}

.login-actions .login-qr-toggle {
  flex: 0 0 auto;
  min-width: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: auto;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  border: 1.25px solid rgba(37, 99, 235, 0.2);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.12);
}

.login-actions .login-qr-toggle:hover:not(:disabled),
.login-actions .login-qr-toggle:focus-visible {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 3px var(--color-primary-soft), 0 10px 18px rgba(37, 99, 235, 0.18);
}

.login-qr-toggle-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.login-secondary-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-2);
  position: relative;
  gap: var(--space-2);
  align-items: center;
}

.forgot-password-button {
  padding: 0;
  min-width: auto;
  flex: 0;
  font-size: 0.8rem;
  line-height: 1.2;
  color: #64748b;
  font-weight: var(--font-weight-medium);
  background: transparent;
  border: 0;
  white-space: nowrap;
}

.forgot-password-button:hover,
.forgot-password-button:focus {
  color: #0f172a;
  text-decoration: underline;
}

.support-popover {
  position: absolute;
  top: calc(100% + var(--space-3));
  right: 0;
  width: min(320px, 85vw);
  background: #ffffff;
  border: 1.25px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 36px rgba(15, 23, 42, 0.18);
  padding: var(--space-4);
  z-index: 20;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

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

.support-popover::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 16px;
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: transparent transparent rgba(148, 163, 184, 0.28) transparent;
}

.support-popover::after {
  content: "";
  position: absolute;
  top: -8px;
  right: 18px;
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent #ffffff transparent;
}

.support-popover-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.support-popover-content p {
  margin: 0;
  color: #0f172a;
  line-height: 1.5;
}

.support-popover-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

.support-popover-actions .primary-button,
.support-popover-actions .secondary-button {
  flex: 1;
}

label {
  display: block;
  font-weight: var(--font-weight-medium);
}

select,
input,
textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  color: inherit;
  font: inherit;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  cursor: text;
}

select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: calc(var(--space-4) * 2.5);
  background-color: var(--color-surface);
  background-repeat: no-repeat;
  background-position: right calc(var(--space-4) * 0.75) center;
  background-size: 10px 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%232563eb' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  background-color: var(--color-surface);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

.system-config-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: var(--space-4);
}

.system-config-layout {
  display: block;
}

.system-config-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.system-config-accordion-stack {
  width: 100%;
}

.system-config-card {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: var(--space-2);
  box-shadow: var(--shadow-sm);
}

.system-config-card:target {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.system-config-card-header {
  margin-bottom: var(--space-3);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.system-config-accordion-summary {
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.system-config-accordion-summary::-webkit-details-marker {
  display: none;
}

.system-config-accordion-card[open] > .system-config-accordion-summary {
  margin-bottom: var(--space-3);
}

.system-config-accordion-summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

.system-config-accordion-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-left: auto;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.system-config-accordion-toggle::before {
  content: "+";
  line-height: 1;
}

.system-config-accordion-card[open] > .system-config-accordion-summary .system-config-accordion-toggle::before {
  content: "-";
}

.system-config-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex: 0 0 auto;
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
}

.system-config-card-icon.icon-hr {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.system-config-card-icon.icon-email {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.system-config-card-icon.icon-performance {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.system-config-card-icon.icon-backup {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.system-config-card-icon.icon-ui {
  background: rgba(236, 72, 153, 0.12);
  color: #db2777;
}

.system-config-card-icon.icon-logging {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
}

.config-grid,
.system-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-1);
}

.config-grid .form-field,
.config-block {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: var(--space-2);
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.config-grid .form-field label,
.config-grid .toggle-switch-label,
.config-block label,
.config-block .toggle-switch-label {
  font-weight: var(--font-weight-medium);
  color: var(--color-heading);
  line-height: 1.35;
  word-break: break-word;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.config-grid .form-field .form-hint,
.config-block .form-hint {
  margin: 0;
  word-break: break-word;
}

.config-grid .form-field.form-field--wide {
  grid-column: 1 / -1;
}

.config-block .config-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.config-block .config-title strong {
  font-size: 0.95rem;
}

.config-block .config-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.config-block .config-field[data-tooltip] {
  position: relative;
}

.config-block .config-field[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + var(--space-2));
  left: 0;
  transform: translate(0, 0);
  background: #fff;
  color: var(--color-heading);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1.25px solid var(--color-border);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08),
    0 0 30px 30px rgba(15, 23, 42, 0.05);
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  max-width: 360px;
  min-width: 180px;
  width: max-content;
  white-space: pre-line;
  text-align: left;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.config-block .config-field[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 24px;
  border-width: 6px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  pointer-events: none;
  z-index: 15;
}

.config-block .config-field[data-tooltip]:hover::after,
.config-block .config-field[data-tooltip]:focus-within::after {
  opacity: 1;
  transform: translate(0, -4px);
}

.config-block .config-field[data-tooltip]:hover::before,
.config-block .config-field[data-tooltip]:focus-within::before {
  opacity: 1;
  transform: translate(0, -2px);
}

.config-block .config-input-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.config-block.disabled {
  opacity: 0.5;
}

.config-block.disabled input:not([data-no-toggle-disable]) {
  pointer-events: none;
}

.system-config-card input,
.system-config-card select,
.system-config-card textarea,
.system-config-card .input-with-suffix {
  width: 100%;
  min-width: 0;
  max-width: 280px;
}

.system-config-card .toggle-switch.toggle-switch--inline {
  width: 100%;
  align-items: flex-start;
}

.system-config-card .toggle-switch.toggle-switch--inline .toggle-switch-label {
  flex: 1 1 0;
}

.config-tooltip-button {
  appearance: none;
  border: 1px solid var(--color-border-strong, rgba(148, 163, 184, 0.6));
  border-radius: 999px;
  width: 1.85em;
  height: 1.85em;
  background: transparent;
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: border-color var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.config-tooltip-button--inline {
  margin-left: 0.35rem;
}

.config-tooltip-button:hover,
.config-tooltip-button:focus-visible {
  color: var(--color-primary);
  border-color: rgba(79, 70, 229, 0.9);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
  outline: none;
}

.config-tooltip-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + var(--space-2));
  left: 50%;
  transform: translate(-50%, 0);
  background: #fff;
  color: var(--color-heading);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1.25px solid var(--color-border);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08), 0 0 30px 30px rgba(15, 23, 42, 0.05);
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  max-width: 420px;
  min-width: 180px;
  width: max-content;
  white-space: pre-line;
  text-align: left;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.config-tooltip-button[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  pointer-events: none;
  z-index: 15;
}

.config-tooltip-button[data-tooltip]:hover::after,
.config-tooltip-button[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, -4px);
}

.config-tooltip-button[data-tooltip]:hover::before,
.config-tooltip-button[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, -2px);
}

.system-config-card .config-tooltip-button[data-tooltip]::after,
.system-config-card .config-tooltip-button[data-tooltip]::before {
  display: none;
}

.system-config-card .config-tooltip-button[data-tooltip]:hover::after,
.system-config-card .config-tooltip-button[data-tooltip]:focus-visible::after,
.system-config-card .config-tooltip-button[data-tooltip]:hover::before,
.system-config-card .config-tooltip-button[data-tooltip]:focus-visible::before {
  display: block;
}

.checkbox-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.system-config-status {
  margin-top: var(--space-2);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.system-config-status.is-success {
  color: var(--color-success, #166534);
}

.system-config-status.is-error {
  color: var(--color-danger, #dc2626);
}

.system-config-section > summary {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.system-config-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.system-config-summary h4 {
  margin: 0;
  font-size: 1rem;
}

.system-config-summary p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.system-config-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.system-config-subsection {
  border: 1.25px dashed rgba(148, 163, 184, 0.6);
  border-radius: var(--radius-md);
  background: rgba(241, 245, 249, 0.5);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.system-config-subsection + .system-config-subsection {
  margin-top: var(--space-2);
}

.system-config-subheader h5 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-heading);
}

.system-config-subheader p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.input-with-suffix {
  display: flex;
  align-items: stretch;
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.input-with-suffix input {
  border: none;
  border-right: 1.25px solid var(--color-border);
  border-radius: 0;
}

.input-with-suffix .input-suffix {
  background: rgba(148, 163, 184, 0.12);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  padding: 0 var(--space-3);
  display: inline-flex;
  align-items: center;
}

.chip-preview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  min-height: 28px;
}

.chip-preview[data-empty="true"] {
  opacity: 0.7;
}

.chip {
  padding: 0.1rem 0.65rem;
  border-radius: 12px;
  font-size: 0.85rem;
  border: 1.25px solid rgba(148, 163, 184, 0.5);
  background: rgba(241, 245, 249, 0.8);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.chip-preview .chip {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chip--empty {
  font-style: italic;
}

.chip-preview--color .chip {
  border: none;
  color: #fff;
  background: var(--chip-color, #2563eb);
}

.system-config-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.system-config-actions-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.system-config-actions-buttons {
  display: flex;
  gap: var(--space-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
}

.badge-muted {
  background: rgba(148, 163, 184, 0.2);
  color: var(--color-text-muted);
}

.badge-success {
  color: #15803d;
}

.badge-warning {
  color: #c2410c;
}

.backup-v2-shell {
  display: grid;
  grid-template-columns: minmax(220px, 230px) 1fr;
  gap: var(--space-2);
  align-items: flex-start;
}

.backup-v2-nav {
  position: sticky;
  top: var(--space-5);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.backup-v2-nav h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.backup-v2-nav .small-text {
  margin: 0;
}

.backup-v2-nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
}

.backup-v2-nav-item {
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, #f8fafc 0%, #f3f4f6 100%);
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.backup-v2-nav-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.backup-v2-nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, #4f8dfd 0%, #1d4ed8 100%);
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
}

.backup-v2-card .checkbox-line {
  align-items: center;
  align-self: end;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
}

.backup-v2-card .checkbox-line input {
  flex: 0 0 auto;
}

.backup-v2-nav-item .badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  color: currentColor;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.backup-v2-nav-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  background: center/contain no-repeat;
}

.backup-v2-files-table .col-select {
  width: 44px;
}

.backup-v2-files-table .col-size {
  width: 80px;
  text-align: right;
}

.backup-v2-files-table .col-date {
  width: 120px;
  white-space: nowrap;
}

.backup-v2-jobs-table-wrap {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  max-height: min(42vh, 360px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.backup-v2-jobs-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 100%;
}

.backup-v2-jobs-table th,
.backup-v2-jobs-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.backup-v2-jobs-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

.backup-v2-jobs-table th:nth-child(1) {
  width: 42%;
}

.backup-v2-jobs-table th:nth-child(2) {
  width: 24%;
}

.backup-v2-jobs-table th:nth-child(3),
.backup-v2-jobs-table th:nth-child(4) {
  width: 17%;
}

.backup-v2-jobs-table tbody tr:last-child td {
  border-bottom: 0;
}

.backup-v2-job-row {
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.backup-v2-job-row:hover,
.backup-v2-job-row:focus-visible,
.backup-v2-job-row.is-active {
  background: #f8fafc;
}

.backup-v2-job-row:focus-visible {
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.7);
}

.backup-v2-job-row.is-active {
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.9);
}

.backup-v2-job-cell-main,
.backup-v2-job-time {
  min-width: 0;
}

.backup-v2-job-id {
  color: #0f172a;
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  max-width: min(100%, 620px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-v2-job-scope {
  color: #64748b;
  display: block;
  font-size: 0.85rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-v2-job-status,
.backup-v2-job-verify {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.backup-v2-job-status.is-success,
.backup-v2-job-verify.is-ok {
  border-color: rgba(22, 163, 74, 0.24);
  color: #15803d;
}

.backup-v2-job-status.is-error,
.backup-v2-job-verify.is-fail {
  border-color: rgba(220, 38, 38, 0.22);
  color: #b91c1c;
}

.backup-v2-job-status.is-active {
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
}

.backup-v2-job-status.is-pending {
  border-color: rgba(245, 158, 11, 0.28);
  color: #b45309;
}

.backup-v2-job-status.is-muted {
  border-color: rgba(100, 116, 139, 0.2);
  color: #475569;
}

.backup-v2-job-badge-stack {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.backup-v2-job-created,
.backup-v2-job-subline,
.backup-v2-job-progress-text,
.backup-v2-job-muted {
  display: block;
  font-size: 0.82rem;
  line-height: 1.4;
}

.backup-v2-job-created,
.backup-v2-job-progress-text {
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backup-v2-job-subline,
.backup-v2-job-muted {
  color: #64748b;
}

.backup-v2-job-progress-text {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .backup-v2-jobs-table-wrap {
    max-height: 320px;
  }

  .backup-v2-jobs-table {
    min-width: 680px;
  }
}

.backup-v2-job-log {
  border-top: 1px solid var(--border-color, #e5e7eb);
  margin-top: 16px;
  padding-top: 14px;
}

.backup-v2-job-log-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.backup-v2-job-log-header h5 {
  font-size: 0.95rem;
  margin: 0;
}

.backup-v2-job-progress {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 12px;
  padding: 10px;
}

.backup-v2-job-progress .metric {
  min-width: 0;
}

.backup-v2-job-progress .label {
  color: #64748b;
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.backup-v2-job-progress .value {
  color: #111827;
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.backup-v2-job-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 12px 0 0;
  max-height: 260px;
  overflow: auto;
  padding: 0;
}

.backup-v2-job-log-item {
  border-left: 3px solid #9ca3af;
  padding: 2px 0 2px 10px;
}

.backup-v2-job-log-item.is-success {
  border-left-color: #16a34a;
}

.backup-v2-job-log-item.is-warning {
  border-left-color: #d97706;
}

.backup-v2-job-log-item.is-error {
  border-left-color: #dc2626;
}

.backup-v2-job-log-line {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.backup-v2-job-log-message {
  font-size: 0.9rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.backup-v2-job-log-time {
  color: #64748b;
  flex: 0 0 auto;
  font-size: 0.78rem;
}

.backup-v2-job-log-detail {
  color: #64748b;
  font-size: 0.78rem;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.backup-v2-files-table {
  table-layout: fixed;
}

.backup-v2-files-table .col-name {
  width: 100%;
}

.backup-v2-files-table td.truncate {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backup-v2-job-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: var(--font-weight-semibold);
  font-size: 12px;
  line-height: 1;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.backup-v2-job-type::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.backup-v2-job-type.is-export {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.3);
}

.backup-v2-job-type.is-storage {
  color: #047857;
  border-color: rgba(4, 120, 87, 0.3);
}

.backup-v2-job-type.is-restore {
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.3);
}

.backup-v2-job-type.is-verify {
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.3);
}

.backup-v2-job-type.is-cleanup {
  color: #0ea5e9;
  border-color: rgba(14, 165, 233, 0.3);
}

.backup-v2-job-type.is-cancel {
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.3);
}

.backup-icon-create {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='6' width='16' height='12' rx='3' stroke='%232256e8' stroke-width='1.5'/%3E%3Cpath d='M8 10h8M8 14h5' stroke='%232256e8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.backup-icon-restore {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5a7 7 0 1 0 7 7' stroke='%232256e8' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M12 3v4l2-2.5' stroke='%232256e8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.backup-icon-jobs {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='6' width='16' height='12' rx='2.5' stroke='%232256e8' stroke-width='1.5'/%3E%3Cpath d='M4 10h16M9 6V4h6v2' stroke='%232256e8' stroke-width='1.5'/%3E%3C/svg%3E");
}

.backup-icon-snapshots {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='5' y='5' width='14' height='14' rx='3' stroke='%232256e8' stroke-width='1.5'/%3E%3Ccircle cx='12' cy='12' r='3.5' stroke='%232256e8' stroke-width='1.5'/%3E%3C/svg%3E");
}

.backup-v2-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.backup-v2-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.backup-v2-hero h3 {
  margin: 0 0 4px;
}

.backup-v2-hero .small-text {
  margin: 0;
}

.preview-pane {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  background: #f8fafc;
}

.preview-pane .muted {
  margin: 0;
}

.preview-section + .preview-section {
  margin-top: var(--space-3);
}

.preview-heading {
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
}

.preview-pane .code-block.small-text {
  max-height: 500px;
  overflow: auto;
}

.manifest-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.manifest-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}
.manifest-card h5 {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}
.kv-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-start;
}
.kv-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f9fafb;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  min-width: 180px;
  flex: 1 1 220px;
}
.kv-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.kv-value {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  word-break: break-all;
  max-height: 4.5rem;
  overflow: auto;
}
.manifest-files-table,
.manifest-sample-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.manifest-files-table th,
.manifest-files-table td,
.manifest-sample-table th,
.manifest-sample-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.manifest-files-table th,
.manifest-sample-table th {
  background: #f1f5f9;
  font-weight: var(--font-weight-semibold);
}
.manifest-files-table tr:hover,
.manifest-sample-table tr:hover {
  background: #f8fafc;
}
.manifest-files-table .muted,
.manifest-sample-table .muted {
  color: var(--color-text-muted);
}

.manifest-card .table-container.scrollable {
  max-height: 320px;
  overflow-y: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  font-weight: var(--font-weight-semibold);
  font-size: 0.85rem;
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-text);
}

.pill.live {
  background: linear-gradient(135deg, #4f8dfd 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.backup-v2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-3);
}

.backup-v2-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.backup-v2-card .badge {
  font-size: 0.85rem;
}

.backup-v2-range-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-3);
}

.backup-v2-range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.backup-v2-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.backup-v2-presets .chip {
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  background: #fff;
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
}

.backup-v2-presets .chip.ghost {
  background: #fff;
}

.backup-v2-presets .chip.is-active {
  background: linear-gradient(135deg, #4f8dfd 0%, #2563eb 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.backup-v2-presets .chip.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.backup-v2-range-box .form-hint.error {
  color: #b91c1c;
  margin: var(--space-1) 0 0;
}

.backup-v2-create-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-3);
  align-items: start;
}

.backup-v2-create-main,
.backup-v2-create-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.backup-v2-create-side.is-hidden {
  display: none;
}

.backup-v2-create-layout.single-column {
  grid-template-columns: 1fr;
}

.backup-v2-collections-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-3);
}

.backup-v2-collections-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.backup-v2-collections-search {
  margin-bottom: var(--space-2);
}

.backup-v2-collections-list {
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface);
  display: grid;
  gap: 0.5rem;
}

.backup-v2-collection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}

.backup-v2-collection-row:hover {
  background: rgba(148, 163, 184, 0.12);
}

.backup-v2-collection-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.backup-v2-collection-meta .badge {
  font-size: 0.75rem;
  background: rgba(148, 163, 184, 0.2);
}

.backup-v2-collection-name {
  font-weight: var(--font-weight-semibold);
}

.backup-v2-collection-estimate {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.backup-v2-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.75rem;
  font-size: 0.95rem;
}

.backup-v2-breadcrumb .link-button {
  padding: 0;
  border: none;
  background: none;
  color: #1b4cff;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}

.backup-v2-breadcrumb .link-button:hover,
.backup-v2-breadcrumb .link-button:focus-visible {
  text-decoration: underline;
}

.backup-v2-breadcrumb .breadcrumb-sep {
  color: var(--color-text-muted);
}

.input-inline.align-center {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.input-inline .input-inline-group {
  display: flex;
  align-items: stretch;
  gap: var(--space-1);
  width: 100%;
}

.input-inline .input-inline-group input[type="text"],
.input-inline .input-inline-group input[type="search"] {
  flex: 1 1 auto;
}

.backup-v2-manifest-row {
  gap: var(--space-2);
}

.backup-v2-manifest-row .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.backup-v2-selected-list {
  margin-top: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface);
}

.backup-v2-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.backup-v2-selected-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: var(--font-weight-semibold);
}

.backup-v2-selected-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.backup-v2-selected-actions .small {
  padding: 0.35rem 0.65rem;
  font-size: 0.9rem;
}

.backup-v2-selected-actions-inline {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.backup-v2-selected-actions-inline.end-align {
  justify-content: flex-end;
}

.backup-v2-restore-inline {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.backup-v2-storage-restore-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  align-items: end;
}

.backup-v2-storage-restore-grid > * {
  box-sizing: border-box;
  min-width: 0;
}

.backup-v2-storage-restore-grid input,
.backup-v2-storage-restore-grid select {
  box-sizing: border-box;
  max-width: 100%;
}

.backup-v2-card .backup-v2-storage-confirm {
  grid-column: 1 / -1;
  align-self: stretch;
  align-items: flex-start;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.backup-v2-storage-confirm input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0;
  margin-top: 0.15rem;
  padding: 0;
}

.backup-v2-storage-confirm span {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .backup-v2-storage-restore-grid {
    grid-template-columns: 1fr;
  }
}

.backup-v2-storage-diff {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  padding: 12px;
  margin: 10px 0;
}

.backup-v2-storage-diff-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.backup-v2-storage-diff-header h5 {
  margin: 0;
  font-size: 0.98rem;
}

.backup-v2-storage-diff-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.backup-v2-storage-diff-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.backup-v2-storage-diff-metric .label {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.backup-v2-storage-diff-metric strong {
  font-size: 1rem;
}

.backup-v2-storage-diff-metric.is-restore strong {
  color: #1d4ed8;
}

.backup-v2-storage-diff-metric.is-identical strong {
  color: #047857;
}

.backup-v2-storage-diff-metric.is-skipped strong,
.backup-v2-storage-diff-metric.is-extra strong {
  color: #b45309;
}

.backup-v2-storage-diff-metric.is-blocked strong {
  color: #b91c1c;
}

.backup-v2-storage-diff-table-wrap {
  max-height: 220px;
}

.backup-v2-storage-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.backup-v2-storage-diff-table th,
.backup-v2-storage-diff-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.backup-v2-storage-diff-table td:nth-child(2) {
  word-break: break-word;
}

.backup-verify-btn {
  min-width: 112px;
  padding: 0.6rem 1rem;
  font-weight: var(--font-weight-semibold);
  font-size: 0.95rem;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
}
.backup-restore-btn {
  min-width: 112px;
  padding: 0.6rem 1rem;
  font-weight: var(--font-weight-semibold);
  font-size: 0.95rem;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
}
.backup-verify-btn.verify-good {
  background-color: #12b76a;
  color: #fff;
  border-color: #12b76a;
}
.backup-verify-btn.verify-good:hover,
.backup-verify-btn.verify-good:focus {
  background-color: #0f9e5c;
  color: #fff;
  border-color: #0f9e5c;
}
.backup-verify-btn.verify-good:disabled {
  opacity: 0.95;
  color: #fff;
}
.backup-verify-btn.verify-miss {
  background-color: #f79009;
  color: #fff;
  border-color: #f79009;
}
.backup-verify-btn.verify-miss:hover,
.backup-verify-btn.verify-miss:focus {
  background-color: #de7f05;
  color: #fff;
  border-color: #de7f05;
}
.backup-verify-btn.verify-miss:disabled {
  opacity: 0.95;
  color: #fff;
}
.backup-restore-btn.restore-good {
  background-color: #12b76a;
  color: #fff;
  border-color: #12b76a;
}
.backup-restore-btn.restore-good:hover,
.backup-restore-btn.restore-good:focus {
  background-color: #0f9e5c;
  color: #fff;
  border-color: #0f9e5c;
}
.backup-restore-btn.restore-good:disabled {
  opacity: 0.95;
  color: #fff;
}
.backup-restore-btn.restore-miss {
  background-color: #f79009;
  color: #fff;
  border-color: #f79009;
}
.backup-restore-btn.restore-miss:hover,
.backup-restore-btn.restore-miss:focus {
  background-color: #de7f05;
  color: #fff;
  border-color: #de7f05;
}
.backup-restore-btn.restore-miss:disabled {
  opacity: 0.95;
  color: #fff;
}

.backup-v2-selected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-2);
  max-height: 260px;
  overflow: auto;
}

.backup-v2-selected-item {
  position: relative;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-strong);
  min-height: 82px;
}

.backup-v2-selected-name {
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.2rem;
}

.backup-v2-selected-meta {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.backup-v2-selected-item .chip-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.backup-v2-selected-item .chip-close:hover,
.backup-v2-selected-item .chip-close:focus-visible {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.4);
}

.backup-v2-preview-selector {
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
  margin-top: var(--space-2);
}

.backup-v2-preview-selector select {
  min-width: 240px;
}

.icon-folder-open {
  width: 18px;
  height: 18px;
  display: inline-block;
  background: no-repeat center/contain;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='16' viewBox='0 0 20 16' fill='none'><path d='M2.5 4.5A1.5 1.5 0 0 1 4 3h4.1a1.5 1.5 0 0 1 1.07.44l1.1 1.1H16a1.5 1.5 0 0 1 1.5 1.5v6.96a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12.5V4.5Z' fill='%23eef2ff' stroke='%236b74ff' stroke-width='1.2'/></svg>");
}

.backup-v2-explorer {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-3);
  align-items: start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}

.backup-v2-folders {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: var(--space-2);
  box-shadow: var(--shadow-xs);
}

.backup-v2-folders-header {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
  margin-top: 32px;
}

.backup-v2-folders-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  max-height: 520px;
  overflow: auto;
}

#backupV2SnapshotRecent,
#backupV2SnapshotShortcuts {
  width: 100%;
}

#backupV2SnapshotRecent .link-button,
#backupV2SnapshotShortcuts .link-button {
  align-self: flex-start;
  text-align: left;
  width: 100%;
}

.backup-v2-folder-item {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 0.45rem 0.6rem;
  text-align: left;
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.backup-v2-folder-item:hover,
.backup-v2-folder-item:focus-visible {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.4);
}

.backup-v2-folder-item.is-active {
  border-color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}

.backup-v2-folder-row td {
  font-weight: var(--font-weight-semibold);
}

.backup-v2-folder-row .badge.subtle {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.backup-v2-file-row.is-active {
  background: rgba(59, 130, 246, 0.08);
}
.backup-v2-select-all td {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.backup-v2-folder-row.is-active {
  background: rgba(59, 130, 246, 0.08);
}

.backup-v2-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.35rem;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.checkbox-col {
  width: 48px;
  text-align: center;
}

.checkbox-cell {
  text-align: center;
  width: 48px;
}

.backup-v2-updated .date {
  font-weight: var(--font-weight-semibold);
}

.backup-v2-updated .time {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.2;
}

.backup-v2-file-icon.folder {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='16' viewBox='0 0 20 16' fill='none'><path d='M2.5 3.5A1.5 1.5 0 0 1 4 2h4.1a1.5 1.5 0 0 1 1.07.44l1.1 1.1H16a1.5 1.5 0 0 1 1.5 1.5v6.96a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12.5V3.5Z' fill='%23dbeafe' stroke='%235694ff' stroke-width='1.2'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.backup-v2-file-icon.file {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='18' viewBox='0 0 16 18' fill='none'><path d='M3.5 1.5h5.8l3.2 3.2v11.8a1 1 0 0 1-1 1H3.5a1 1 0 0 1-1-1v-14a1 1 0 0 1 1-1Z' fill='%23eef2ff' stroke='%236b74ff' stroke-width='1.1'/><path d='M9.3 1.5V4a1 1 0 0 0 1 1h2.4' stroke='%236b74ff' stroke-width='1.1'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.backup-v2-modal {
  width: 1300px !important;
  max-width: 1300px !important;
  min-width: 1200px;
  height: 850px !important;
  max-height: 850px !important;
  min-height: 850px;
}

@media (max-width: 1080px) {
  .backup-v2-shell {
    grid-template-columns: 1fr;
  }

  .backup-v2-create-layout {
    grid-template-columns: 1fr;
  }

  .backup-v2-nav {
    position: static;
  }

  .backup-v2-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
.backup-v2-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
  margin-left: auto;
}

.backup-v2-actions .badge {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  white-space: nowrap;
}

.backup-v2-actions .badge.is-active {
  background: var(--color-primary-50, #eef2ff);
  border-color: var(--color-primary-200, #c7d2fe);
  color: var(--color-primary-700, #4338ca);
}

.backup-v2-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.backup-v2-stepper .step {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.backup-v2-stepper .step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-50, #eef2ff);
  color: var(--color-primary-700, #4338ca);
  font-weight: var(--font-weight-semibold);
  border: 1px solid var(--color-primary-200, #c7d2fe);
}

.backup-v2-stepper .step-body h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.backup-v2-stepper .step-body p {
  margin: 0;
}

.backup-v2-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.backup-v2-card-header .backup-v2-card-actions {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.backup-v2-snapshot-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.backup-v2-snapshot-actions.is-busy {
  opacity: 0.82;
}

.backup-v2-action-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.backup-v2-action-divider {
  width: 1px;
  height: 28px;
  background: rgba(148, 163, 184, 0.34);
}

.backup-v2-snapshot-actions .backup-v2-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-color: rgba(148, 163, 184, 0.44);
  background: rgba(255, 255, 255, 0.84);
  color: #334155;
  line-height: 1;
  box-shadow: none;
}

.backup-v2-snapshot-actions .backup-v2-icon-button:hover:not(:disabled),
.backup-v2-snapshot-actions .backup-v2-icon-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.38);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
}

.backup-v2-snapshot-actions .backup-v2-icon-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.backup-v2-snapshot-actions .backup-v2-icon-button svg * {
  fill: none;
}

.backup-v2-download-actions .backup-v2-icon-button {
  color: var(--color-primary);
}

.backup-v2-danger-actions .backup-v2-icon-button {
  color: #b91c1c;
}

.backup-v2-snapshot-actions .backup-v2-icon-button.is-danger:hover:not(:disabled),
.backup-v2-snapshot-actions .backup-v2-icon-button.is-danger:focus-visible {
  border-color: rgba(185, 28, 28, 0.38);
  background: rgba(254, 226, 226, 0.82);
  color: #991b1b;
}

.backup-v2-snapshot-transfer-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 38px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.82);
  color: #1e3a8a;
  font-size: 0.88rem;
}

.backup-v2-snapshot-transfer-status[hidden] {
  display: none;
}

.backup-v2-snapshot-transfer-dot {
  width: 9px;
  height: 9px;
  margin-top: 0.38rem;
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.42);
  animation: backup-v2-transfer-pulse 1.2s ease-out infinite;
  flex: 0 0 auto;
}

.backup-v2-snapshot-transfer-text {
  font-weight: var(--font-weight-semibold);
  min-width: 0;
}

.backup-v2-snapshot-transfer-detail {
  color: #475569;
  min-width: 0;
  overflow-wrap: anywhere;
}

.backup-v2-snapshot-transfer-detail:not(:empty)::before {
  content: "•";
  margin: 0 0.4rem;
  color: #94a3b8;
}

@keyframes backup-v2-transfer-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.42);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.backup-v2-snapshot-actions .backup-v2-icon-button[data-tooltip]:hover::after,
.backup-v2-snapshot-actions .backup-v2-icon-button[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  transform: translateX(50%);
  padding: 5px 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.backup-v2-snapshot-actions .backup-v2-icon-button[data-tooltip]:hover::before,
.backup-v2-snapshot-actions .backup-v2-icon-button[data-tooltip]:focus-visible::before {
  content: "";
  position: absolute;
  right: 50%;
  bottom: calc(100% + 3px);
  z-index: 21;
  transform: translateX(50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
}

@media (max-width: 720px) {
  .backup-v2-card-header .backup-v2-card-actions,
  .backup-v2-snapshot-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.backup-v2-snapshots-summary {
  margin-top: 8px;
}

.snapshot-browser-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 12px 0;
}

.snapshot-browser-bar .input-inline-group {
  display: flex;
  align-items: center;
  flex: 1;
  gap: var(--space-1);
  min-width: 0;
}

.snapshot-browser-bar input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.snapshot-browser-bar .input-inline-group > button {
  flex: 0 0 auto;
}

.backup-v2-manifest-browser-bar {
  align-items: center;
}

@media (max-width: 640px) {
  .backup-v2-manifest-browser-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

.checkbox-col {
  width: 44px;
}

.backup-v2-explorer .icon-folder-flat {
  width: 18px;
  height: 18px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
  background: no-repeat center/contain;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='16' viewBox='0 0 20 16' fill='none'><path d='M2.5 4.5A1.5 1.5 0 0 1 4 3h4.1a1.5 1.5 0 0 1 1.07.44l1.1 1.1H16a1.5 1.5 0 0 1 1.5 1.5v6.96a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12.5V4.5Z' fill='%23eef2ff' stroke='%236b74ff' stroke-width='1.2'/></svg>");
}

.backup-v2-explorer .icon-file-flat {
  width: 16px;
  height: 16px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
  background: no-repeat center/contain;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='18' viewBox='0 0 16 18' fill='none'><path d='M3.5 2.75h5.25L12.5 6.5v8.75a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-12a1 1 0 0 1 1-1Z' stroke='%236b7280' stroke-width='1.2'/><path d='M8.75 2.5V6h3.5' stroke='%236b7280' stroke-width='1.2'/></svg>");
}

.backup-v2-card h4 {
  margin: 0;
}

.backup-v2-card .muted {
  margin: 4px 0 0;
}

.backup-v2-card .code-block {
  overflow: auto;
  margin-top: 8px;
  margin-bottom: 0px;
}

.backup-v2-placeholder {
  margin-top: var(--space-3);
  font-size: 0.95rem;
}

.system-config-diff-list {
  margin: var(--space-2) 0 var(--space-1);
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.system-config-diff-list li {
  line-height: 1.4;
}

.diff-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.diff-path {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.diff-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  flex-wrap: wrap;
}

.diff-value {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: rgba(148, 163, 184, 0.15);
  border: 1.25px solid rgba(148, 163, 184, 0.3);
}

.diff-value--from {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
}

.diff-value--to {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.diff-arrow {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
}
.required-indicator {
  color: var(--color-danger);
  margin-left: var(--space-1);
  font-weight: var(--font-weight-semibold);
}

.form-hint {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
}

.field-message {
  margin: var(--space-1) 0 var(--space-3);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.field-message-error {
  color: var(--color-danger);
  font-weight: var(--font-weight-medium);
}

.form-message {
  margin: var(--space-2) 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-medium);
  border: 1.25px solid transparent;
}

.form-message.is-error {
  border-color: rgba(152, 103, 66, 0.512);
  color: #7e3d16b7;
}

.form-message.is-success {
  border-color: rgba(22, 163, 74, 0.28);
  color: var(--color-success-hover);
}

.input-error {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.small-text {
  font-size: 0.85rem;
}


button {
  appearance: none;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
  position: relative;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

button.is-loading {
  cursor: wait;
  padding-right: calc(var(--space-5) + 1.5rem);
}

button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--space-4);
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: button-spin 0.65s linear infinite;
}

.primary-button {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.primary-button:disabled {
  background: rgba(37, 99, 235, 0.18);
  color: rgba(15, 23, 42, 0.75);
  border: 1.25px dashed rgba(37, 99, 235, 0.38);
}

.primary-button:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.22);
}

.danger-button {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border: 1.25px solid rgba(220, 38, 38, 0.18);
  border-radius: var(--radius-xl);
}

.danger-button:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.16);
  color: var(--color-danger-hover);
}

.secondary-button {
  background: var(--color-surface);
  border: 1.25px solid var(--color-border);
  color: inherit;
}

.secondary-button:hover:not(:disabled),
.secondary-button:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  outline: none;
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  margin-right: var(--space-2);
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.button-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 999px;
}

.primary-button.icon-expand-button {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.25px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.primary-button.icon-expand-button:hover:not(:disabled),
.primary-button.icon-expand-button:focus-visible {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.2);
}

.icon-expand-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-3);
  min-width: 0;
  height: 50px;
  overflow: visible;
  transition: box-shadow var(--transition-fast), background var(--transition-fast);
}

.icon-expand-button .icon-circle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
  font-size: 1.3rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.primary-button.icon-expand-button:hover:not(:disabled) .icon-circle,
.primary-button.icon-expand-button:focus-visible .icon-circle {
  background: rgba(255, 255, 255, 0.28);
}

.icon-expand-button .icon-label {
  opacity: 1;
  white-space: nowrap;
}

.link-button {
  background: transparent;
  color: var(--color-primary);
  padding: 0;
  border-radius: 0;
  font-weight: var(--font-weight-medium);
}

.link-button:hover:not(:disabled) {
  text-decoration: underline;
}

.toggle-transfer-button {
  margin-top: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-medium);
}

.toggle-transfer-button::after {
  content: "▾";
  font-size: 0.85em;
  transition: transform var(--transition-fast);
}

.toggle-transfer-button[aria-expanded="true"]::after {
  transform: rotate(-180deg);
}

.transfer-panel {
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition: max-height var(--transition-base), opacity var(--transition-base),
    visibility var(--transition-base), margin-top var(--transition-base);
}

.transfer-panel.is-open {
  margin-top: var(--space-4);
  max-height: 1200px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.transfer-panel .surface-card {
  margin-top: 0;
}

.action-bar {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.tab-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.main-tab-button-strip {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: var(--space-3);
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 2px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  padding-left: 24px;
}

.main-tab-button-strip::-webkit-scrollbar {
  height: 6px;
}

.main-tab-button-strip::-webkit-scrollbar-track {
  background: transparent;
}

.main-tab-button-strip::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

#mainTabNav:hover .main-tab-button-strip,
#mainTabNav:focus-within .main-tab-button-strip,
#mainTabNav:active .main-tab-button-strip {
  scrollbar-color: rgba(100, 116, 139, 0.44) transparent;
}

#mainTabNav:hover .main-tab-button-strip::-webkit-scrollbar-thumb,
#mainTabNav:focus-within .main-tab-button-strip::-webkit-scrollbar-thumb,
#mainTabNav:active .main-tab-button-strip::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.36);
}

.tab-menu-toggle {
  display: none;
  align-self: flex-start;
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  color: inherit;
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
  font-weight: var(--font-weight-semibold);
  gap: var(--space-2);
  align-items: center;
}

.tab-menu-toggle-icon {
  transition: transform var(--transition-base);
}

.tab-menu-toggle[aria-expanded="false"] .tab-menu-toggle-icon {
  transform: rotate(-180deg);
}

.tab-nav.nested {
  margin-top: var(--space-3);
  gap: var(--space-2);
}

.review-panel-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: var(--space-3);
  align-items: flex-start;
  margin-top: var(--space-4);
}

.review-panel-layout.is-collapsed {
  grid-template-columns: 80px 1fr;
}

.review-panel-layout.is-collapsed .review-panel-sidebar {
  width: 80px;
  padding: var(--space-3);
}

.review-panel-layout.is-collapsed .review-panel-grid {
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

.review-panel-layout.is-collapsed .review-panel-heading-row {
  display: none;
}

.review-panel-layout.is-collapsed .settings-nav-item {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
}

.review-panel-layout.is-collapsed .settings-nav-text,
.review-panel-layout.is-collapsed .settings-nav-meta {
  display: none;
}

.review-panel-layout.is-collapsed .settings-nav-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.review-panel-layout.is-collapsed
  .settings-nav-item[data-has-alert="true"]
  .settings-nav-icon::after,
.review-panel-layout.is-collapsed
  .settings-nav-item[data-has-success="true"]
  .settings-nav-icon::after,
.review-panel-layout.is-collapsed
  .settings-nav-item[data-has-live="true"]
  .settings-nav-icon::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid var(--color-surface);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.review-panel-layout.is-collapsed
  .settings-nav-item[data-has-alert="true"]
  .settings-nav-icon::after {
  background: #f97316;
}

.review-panel-layout.is-collapsed
  .settings-nav-item[data-has-success="true"]
  .settings-nav-icon::after {
  background: #22c55e;
}

.review-panel-layout.is-collapsed
  .settings-nav-item[data-has-live="true"]
  .settings-nav-icon::after {
  background: #3b82f6;
}

.review-panel-layout.is-collapsed .review-panel-toggle-floating {
  display: inline-flex;
}

.review-panel-sidebar {
  position: sticky;
  top: var(--space-5);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.review-panel-heading {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.review-panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.review-panel-toggle {
  position: static;
  margin-right: var(--space-4);
  margin-top: var(--space-4);
}

.review-panel-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.review-panel-toggle-floating {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: none;
  z-index: 2;
}

.review-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin: 0;
}

.review-panel-grid .tab-button {
  border: none;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  text-align: left;
}

.review-panel-grid .tab-button:focus-visible {
  outline: none;
}

.review-panel-grid .settings-nav-item {
  width: 100%;
}

@media (max-width: 960px) {
  .review-panel-layout {
    grid-template-columns: 1fr;
  }
  .review-panel-sidebar {
    position: static;
    width: 100%;
  }
  .review-panel-heading-row {
    justify-content: flex-start;
    gap: var(--space-3);
  }
  .review-panel-layout.is-collapsed {
    grid-template-columns: 1fr;
  }
  .review-panel-layout.is-collapsed .review-panel-sidebar {
    width: 100%;
  }
  .review-panel-layout.is-collapsed .settings-nav-item {
    flex-direction: row;
    align-items: center;
  }
  .review-panel-layout.is-collapsed .settings-nav-text,
  .review-panel-layout.is-collapsed .settings-nav-meta {
    display: flex;
  }
}

.review-panel-layout.is-collapsed .review-panel-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.review-panel-layout.is-collapsed .review-panel-grid {
  margin-top: 0;
}

.review-panel-layout.is-collapsed .review-panel-toggle-floating {
  position: static;
  display: inline-flex;
  margin: 0 auto var(--space-3);
  align-self: center;
}


.tab-button.nested {
  padding: var(--space-2);
  font-size: 0.95rem;
}

.nested-tabs {
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-hub-wrapper {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.settings-hub {
  display: grid;
  grid-template-columns: clamp(260px, 22vw, 320px) minmax(0, 1fr);
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  position: relative;
  overflow: visible;
  transition: grid-template-columns var(--transition-base);
}

.settings-hub-sidebar {
  grid-column: 1;
  width: auto;
  background: var(--color-surface);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: var(--space-6);
  align-self: flex-start;
  justify-self: stretch;
  transition: width var(--transition-base), padding var(--transition-base),
    box-shadow var(--transition-base);
}

.settings-hub-header h2 {
  margin: 0;
}

.eyebrow-heading {
  margin: 0 8px var(--space-1);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.settings-hub-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-4);
}

.settings-hub-nav-search {
  margin-top: var(--space-3);
}

.settings-hub-nav-search .search-input {
  width: 100%;
  min-height: 2.5rem;
  font-size: 0.88rem;
}

.settings-nav-empty {
  margin: var(--space-2) 0 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.settings-nav-item.is-nav-filter-hidden {
  display: none !important;
}

.settings-nav-item {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-xl);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1.25px solid transparent;
  box-shadow: none;
  outline: none;
}

.settings-nav-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-xl);
  background: var(--color-surface-subtle);
  border: 1.25px solid rgba(148, 163, 184, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.settings-nav-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  color: var(--color-text-muted);
}

.settings-nav-item.active .settings-nav-icon {
  border-color: transparent;
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
}

.settings-nav-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  align-items: flex-start;
}

.settings-nav-item .settings-nav-title {
  font-weight: var(--font-weight-semibold);
  font-size: 1.1rem;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.2;
}

.settings-nav-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 48px;
  margin-left: auto;
}

.settings-nav-item[data-has-alert="true"] .settings-nav-meta {
  min-width: 48px;
}

.settings-hub .settings-nav-meta {
  display: none;
}

.settings-hub:not(.is-sidebar-collapsed)
  .settings-nav-item[data-has-alert="true"]
  .settings-nav-meta,
.settings-hub:not(.is-sidebar-collapsed)
  .settings-nav-item[data-has-success="true"]
  .settings-nav-meta,
.settings-hub:not(.is-sidebar-collapsed)
  .settings-nav-item[data-has-info="true"]
  .settings-nav-meta {
  display: flex;
}

.settings-hub .settings-nav-item:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.settings-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  border: 1.25px solid rgba(59, 130, 246, 0.3);
}

.settings-nav-badge--alert {
  padding: 0 0.4rem;
  color: #b91c1c;
}

.settings-nav-badge--success {
  border-color: rgba(34, 197, 94, 0.35);
  color: #15803d;
}

.settings-nav-item.active .settings-nav-badge {
  background: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.settings-nav-item.active .settings-nav-badge--alert {
  color: #b91c1c;
}

.settings-nav-item.active .settings-nav-badge--success {
  border-color: rgba(15, 187, 170, 0.7);
  color: #15803d;
}

.settings-nav-note {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-align: left;
  line-height: 1.2;
}

.settings-nav-item.active .settings-nav-note {
  color: rgba(255, 255, 255, 0.9);
}

.settings-nav-item:not(.active) {
  background: rgba(255, 255, 255, 0.671);
}

.settings-nav-item:not(.active):hover,
.settings-nav-item:not(.active):focus-visible {
  border-color: transparent;
  box-shadow: none;
}

.settings-nav-item svg path {
  fill: currentColor;
  opacity: 0.75;
  transition: opacity var(--transition-fast);
}

.settings-nav-item.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12);
}

.settings-nav-item.active .settings-nav-title {
  color: #fff;
}

.settings-nav-item.active .settings-nav-desc {
  color: rgba(255, 255, 255, 0.85);
}

.settings-nav-item.active .settings-nav-meta {
  color: rgba(255, 255, 255, 0.85);
}

.settings-nav-item.active svg path {
  opacity: 1;
  fill: #fff;
}

.settings-nav-item.active .settings-nav-icon {
  background: rgba(255, 255, 255, 0.15);
  border-color: transparent;
  color: #fff;
}

.settings-hub-header {
  position: relative;
}

.settings-hub.is-sidebar-collapsed .settings-hub-header {
  padding-bottom: var(--space-2);
  align-items: center;
}

.settings-hub.is-sidebar-collapsed .settings-hub-header h2,
.settings-hub.is-sidebar-collapsed .settings-hub-header p {
  display: none;
}

.settings-hub.is-sidebar-collapsed .settings-hub-nav-search,
.settings-hub.is-sidebar-collapsed .settings-nav-empty {
  display: none;
}

.sidebar-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  min-width: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  transform: scale(1.05);
}

.sidebar-toggle::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transition: opacity var(--transition-fast);
}

.sidebar-toggle.is-collapsed::before {
  opacity: 0.4;
}

.settings-hub.is-sidebar-collapsed .sidebar-toggle {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}

.settings-hub.is-sidebar-collapsed .sidebar-toggle:hover,
.settings-hub.is-sidebar-collapsed .sidebar-toggle:focus-visible {
  transform: translateX(-50%) scale(1.05);
}

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

.settings-hub-content {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  align-self: flex-start;
}

.settings-hub.is-sidebar-collapsed {
  grid-template-columns: 88px minmax(0, 1fr);
}

.settings-hub.is-sidebar-collapsed .settings-hub-sidebar {
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.settings-hub.is-sidebar-collapsed .settings-hub-nav {
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.settings-hub.is-sidebar-collapsed .settings-nav-text,
.settings-hub.is-sidebar-collapsed .settings-nav-meta {
  display: none;
}

.settings-hub.is-sidebar-collapsed .settings-nav-item {
  justify-content: center;
  padding: 0;
  flex-direction: column;
  gap: 0;
  width: 64px;
  height: 64px;
  margin: 0;
  background: transparent;
  box-shadow: none;
  align-items: center;
}

.settings-hub.is-sidebar-collapsed .settings-nav-icon {
  margin: 0;
  width: 48px;
  height: 48px;
}

.settings-hub.is-sidebar-collapsed
  .settings-nav-item[data-has-alert="true"]
  .settings-nav-icon::after,
.settings-hub.is-sidebar-collapsed
  .settings-nav-item[data-has-success="true"]
  .settings-nav-icon::after,
.settings-hub.is-sidebar-collapsed
  .settings-nav-item[data-has-info="true"]
  .settings-nav-icon::after {
  content: "";
  position: absolute;
  top: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid var(--color-surface);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.25);
}

.settings-hub.is-sidebar-collapsed
  .settings-nav-item[data-has-alert="true"]
  .settings-nav-icon::after {
  background: #f97316;
}

.settings-hub.is-sidebar-collapsed
  .settings-nav-item[data-has-success="true"]
  .settings-nav-icon::after {
  background: #22c55e;
}

.settings-hub.is-sidebar-collapsed
  .settings-nav-item[data-has-info="true"]
  .settings-nav-icon::after {
  background: #3b82f6;
}

.settings-hub.is-sidebar-collapsed .settings-nav-icon svg {
  width: 28px;
  height: 28px;
}

.settings-hub.is-sidebar-collapsed .settings-nav-title,
.settings-hub.is-sidebar-collapsed .settings-nav-desc {
  display: none;
}

.settings-hub.is-sidebar-collapsed .settings-nav-meta {
  display: none;
}

.settings-hub.is-sidebar-collapsed .settings-nav-item:not(.active) {
  background: transparent;
}

.settings-hub.is-sidebar-collapsed .settings-nav-item.active {
  background: transparent;
  border: none;
  box-shadow: none;
}

.settings-hub.is-sidebar-collapsed .settings-nav-item.active .settings-nav-icon {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.35);
  width: 56px;
  height: 56px;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-hub-sidebar {
  width: clamp(260px, 22vw, 320px);
  max-width: 380px;
  padding: var(--space-2);
  align-items: stretch;
  box-shadow: var(--shadow-sm);
  z-index: 6;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-hub-header h2,
.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-hub-header p {
  display: block;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .sidebar-toggle {
  left: auto;
  right: 0;
  transform: none;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .sidebar-toggle:hover,
.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .sidebar-toggle:focus-visible {
  transform: scale(1.05);
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-hub-nav {
  width: 100%;
  align-items: stretch;
  gap: var(--space-2);
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-hub-nav-search,
.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-empty {
  display: block;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-text {
  display: flex;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item[data-has-alert="true"]
  .settings-nav-meta,
.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item[data-has-success="true"]
  .settings-nav-meta,
.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item[data-has-info="true"]
  .settings-nav-meta {
  display: flex;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-item {
  justify-content: flex-start;
  padding: var(--space-2);
  flex-direction: row;
  gap: var(--space-3);
  width: 100%;
  height: auto;
  background: rgba(148, 163, 184, 0.08);
  border: 1.25px solid transparent;
  box-shadow: none;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-icon {
  width: 2.5rem;
  height: 2.5rem;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item[data-has-alert="true"]
  .settings-nav-icon::after,
.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item[data-has-success="true"]
  .settings-nav-icon::after,
.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item[data-has-info="true"]
  .settings-nav-icon::after {
  content: none;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-title,
.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-desc {
  display: block;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-item:not(.active) {
  background: rgba(148, 163, 184, 0.08);
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item:not(.active):hover,
.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item:not(.active):focus-visible {
  background: rgba(148, 163, 184, 0.18);
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-item.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12);
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item.active
  .settings-nav-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: none;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item.active
  .settings-nav-badge {
  background: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item.active
  .settings-nav-badge--alert {
  background: #fff7f7;
  border-color: rgba(248, 113, 113, 0.7);
  color: #b91c1c;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking
  .settings-nav-item.active
  .settings-nav-badge--success {
  background: #f1fff7;
  border-color: rgba(34, 197, 94, 0.7);
  color: #15803d;
}

.settings-hub.is-sidebar-collapsed.is-sidebar-peeking .settings-nav-meta {
  align-items: flex-end;
  margin-left: auto;
}

.settings-panel-stack {
  gap: var(--space-5);
  display: flex;
  flex-direction: column;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .settings-hub,
  .settings-hub-sidebar,
  .settings-nav-item,
  .sidebar-toggle {
    transition: none;
  }
}

.settings-panel-card {
  background: var(--color-surface);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  position: relative;
}

.settings-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 8px;
  margin-left: 8px;
}

.settings-panel-desc {
  margin: var(--space-1) 0 0;
}

.panel-meta {
  margin: var(--space-2) 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.panel-help {
  margin-bottom: var(--space-4);
  border: 1.25px dashed var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-subtle);
}

.panel-help summary {
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  list-style: none;
}

.panel-help[open] summary {
  margin-bottom: var(--space-2);
}

.panel-help ul {
  margin: 0;
  padding-left: var(--space-5);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.settings-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.settings-panel-actions.compact-actions {
  gap: 6px;
}

.settings-panel-actions.compact-actions .icon-button {
  width: 30px;
  height: 30px;
  padding: 4px;
}

.icon-button.primary-outline {
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
}

.settings-panel-actions.with-labels {
  gap: 10px;
}

.action-pill {
  display: grid;
  place-items: center;
  gap: 6px;
}

.action-pill .action-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.settings-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

.settings-panel-toolbar > * {
  flex: 1 1 auto;
  min-width: 220px;
}

.settings-panel-toolbar .settings-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  flex: 0 0 auto;
}

.settings-panel-toolbar .settings-toolbar-actions .primary-button,
.settings-panel-toolbar .settings-toolbar-actions .secondary-button,
.settings-panel-toolbar .settings-toolbar-actions .ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.settings-panel-toolbar label {
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-text-muted);
}

.manual-request-toolbar {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) max-content;
  grid-template-areas: "filter search actions";
  align-items: end;
  column-gap: var(--space-4);
  row-gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.manual-request-toolbar label {
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-text-muted);
}

.manual-request-filter-field,
.manual-request-search-field {
  min-width: 0;
}

.manual-request-filter-field {
  grid-area: filter;
}

.manual-request-search-field {
  grid-area: search;
}

.manual-request-search-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
  align-items: stretch;
  min-width: 0;
}

.manual-request-toolbar-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-end;
  padding-left: var(--space-1);
  min-width: 0;
}

.manual-request-toolbar select,
.manual-request-search-control input,
.manual-request-search-control .secondary-button,
.manual-request-toolbar-actions .secondary-button {
  min-height: 44px;
}

.manual-request-search-control .secondary-button,
.manual-request-toolbar-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.manual-request-search-control input {
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}

.manual-request-search-control .secondary-button {
  min-width: 96px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.manual-request-toolbar-actions .secondary-button {
  min-width: 112px;
}

#tab-panel-manual-request {
  container-type: inline-size;
}

@container (max-width: 640px) {
  .manual-request-toolbar {
    grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
    grid-template-areas:
      "filter search"
      ". actions";
  }

  .manual-request-toolbar-actions {
    padding-left: 0;
  }
}

@container (max-width: 560px) {
  .manual-request-toolbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "filter"
      "search"
      "actions";
  }

  .manual-request-search-control {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .manual-request-filter-field,
  .manual-request-search-field,
  .manual-request-toolbar-actions,
  .manual-request-search-control .secondary-button,
  .manual-request-toolbar-actions .secondary-button {
    width: 100%;
    min-width: 0;
  }

  .manual-request-toolbar-actions {
    justify-content: stretch;
    padding-left: 0;
  }

  .manual-request-search-control input {
    border-radius: var(--radius-lg);
    border-right: 1.25px solid var(--color-border);
  }

  .manual-request-search-control .secondary-button {
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 640px) {
  .manual-request-toolbar {
    grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
    grid-template-areas:
      "filter search"
      ". actions";
  }

  .manual-request-toolbar-actions {
    padding-left: 0;
  }
}

#tab-panel-manual-request .table-container.scrollable {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.manual-request-table {
  display: block;
  min-width: 0;
  width: 100%;
  border: 0;
}

.manual-request-table thead {
  display: none;
}

.manual-request-table tbody {
  display: grid;
  gap: var(--space-2);
}

.manual-request-table tr,
.manual-request-table td {
  display: block;
  border: 0;
  padding: 0;
}

#tab-panel-manual-request .manual-request-table tbody tr,
#tab-panel-manual-request .manual-request-table tbody tr:nth-child(odd),
#tab-panel-manual-request .manual-request-table tbody tr:hover,
#tab-panel-manual-request .manual-request-table tbody tr:hover td {
  background: transparent;
}

.manual-request-table th,
.manual-request-table td {
  word-break: normal;
  overflow-wrap: break-word;
}

.manual-request-table td[colspan] {
  padding: 0;
}

.manual-request-table td::before {
  content: none;
}

.manual-request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: var(--space-4);
  align-items: stretch;
  padding: var(--space-4);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated, #fff);
  box-shadow: var(--shadow-sm);
}

.manual-request-card__main {
  display: grid;
  gap: var(--space-3);
}

.manual-request-card__summary {
  position: relative;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
}

.manual-request-card__summary:focus-visible {
  outline: 3px solid var(--color-primary-soft);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

.manual-request-card__label {
  margin-bottom: 0.15rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.manual-request-card__title {
  display: block;
  color: var(--color-heading);
  font-size: 1.12rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
}

.manual-request-card__compact-meta {
  margin-top: 0.25rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.manual-request-card__expand-hint {
  display: inline-flex;
  margin-top: var(--space-2);
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: var(--font-weight-semibold);
}

.manual-request-card.is-compact .manual-request-card__summary > .manual-request-card__text {
  display: none;
}

.manual-request-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-5);
}

.manual-request-card__field strong {
  display: block;
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
}

.manual-request-card__text {
  margin-top: 0.1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.manual-request-card__aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: space-between;
}

.manual-request-card__actions .primary-button,
.manual-request-card__actions .danger-button {
  width: 100%;
  min-width: 0;
  box-shadow: none;
}

.manual-request-card__aside .status-chip {
  align-self: flex-end;
}

.manual-request-card__actions {
  display: grid;
  gap: var(--space-2);
  margin-top: auto;
}

.manual-request-card__actions .primary-button,
.manual-request-card__actions .danger-button {
  min-height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-lg);
}

.manual-request-card__actions .danger-button {
  background: var(--color-surface);
  border-color: rgba(220, 38, 38, 0.28);
}

.manual-request-load-more-cell {
  display: grid !important;
  justify-content: center;
  padding-top: var(--space-2) !important;
}

.manual-request-load-more-button {
  min-width: 180px;
}

@media (max-width: 560px) {
  .manual-request-toolbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "filter"
      "search"
      "actions";
  }

  .manual-request-search-control {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .manual-request-filter-field,
  .manual-request-search-field,
  .manual-request-toolbar-actions,
  .manual-request-search-control .secondary-button,
  .manual-request-toolbar-actions .secondary-button {
    width: 100%;
    min-width: 0;
  }

  .manual-request-toolbar-actions {
    justify-content: stretch;
    padding-left: 0;
  }

  .manual-request-search-control input {
    border-radius: var(--radius-lg);
    border-right: 1.25px solid var(--color-border);
  }

  .manual-request-search-control .secondary-button {
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 768px) {
  .manual-request-card {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .manual-request-card__meta {
    grid-template-columns: 1fr;
  }

  .manual-request-card__aside {
    gap: var(--space-3);
  }

  .manual-request-card__aside .status-chip {
    align-self: flex-start;
  }
}

@media (max-width: 1024px) {
  .settings-hub {
    display: block;
  }
  .settings-hub-sidebar {
    position: static;
    width: 100%;
    margin-bottom: var(--space-4);
  }
  .settings-nav-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .settings-nav-meta {
    min-width: 0;
  }
  .settings-nav-item .settings-nav-desc {
    font-size: 0.75rem;
  }
  .settings-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .settings-panel-card {
    padding: var(--space-4);
    padding-left: 0px;
    padding-right: 0px;
  }
}

.tab-content.nested {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.tab-pane.nested {
  display: none;
}

.tab-pane.nested.active {
  display: block;
}

.tab-button {
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface-subtle);
  color: inherit;
  transition: border-color var(--transition-base), background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}

#mainTabNav .main-tab-button {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  white-space: nowrap;
}

#mainTabNav .tab-icon {
  width: 1.55rem;
  height: 1.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

#mainTabNav .tab-icon svg {
  width: 1.55rem;
  height: 1.55rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#mainTabNav .tab-label {
  line-height: 1.1;
}

.tab-button.tab-settings-button {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.tab-settings-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.tab-button:hover,
.tab-button:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  outline: none;
}

.tab-button.active {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}

.tab-button.utility-button {
  color: var(--color-danger);
  border-color: rgba(220, 38, 38, 0.24);
  background: transparent;
}

.tab-button.utility-button:hover:not(:disabled),
.tab-button.utility-button:focus-visible {
  border-color: var(--color-danger);
  color: var(--color-danger-hover);
  box-shadow: 0 0 0 3px var(--color-danger-soft);
}

.tab-button.greeting-tab {
  pointer-events: none;
  cursor: default;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-style: dashed;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: clamp(9rem, 16vw, 15rem);
  min-height: 2.45rem;
  padding: 0.35rem var(--space-3);
  transition: background var(--transition-base), color var(--transition-base),
    border-color var(--transition-base), box-shadow var(--transition-base);
}

.tab-button.greeting-tab.logged-in {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.24);
  pointer-events: auto;
  cursor: pointer;
}

.tab-button.greeting-tab::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
  flex-shrink: 0;
  transform: translateY(0.5px);
}

.tab-button.greeting-tab.has-avatar::before {
  display: none;
}

.tab-button.greeting-tab .greeting-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  line-height: 1.1;
}

.tab-button.greeting-tab .greeting-name,
.tab-button.greeting-tab .greeting-role {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-button.greeting-tab .greeting-name {
  font-size: 0.82rem;
  font-weight: var(--font-weight-semibold, 600);
}

.tab-button.greeting-tab .greeting-role {
  margin-top: 0.1rem;
  font-size: 0.68rem;
  font-weight: var(--font-weight-medium, 500);
  opacity: 0.78;
}

.user-avatar {
  --avatar-size: 28px;
  --avatar-bg: #94a3b8;
  --avatar-ring: rgba(148, 163, 184, 0.6);
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.26rem;
  font-weight: var(--font-weight-semibold, 600);
  color: #ffffff;
  background: var(--avatar-bg);
  border: 1px solid var(--avatar-ring);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar.size-xs {
  --avatar-size: 30px;
  font-size: 0.77rem;
}

.user-avatar.size-sm {
  --avatar-size: 42px;
  font-size: 0.91rem;
}

.user-avatar.size-md {
  --avatar-size: 52px;
  font-size: 1.05rem;
}

.user-avatar.size-lg {
  --avatar-size: 64px;
  font-size: 1.26rem;
}

.user-avatar.role-specialist {
  --avatar-bg: var(--color-primary);
}

.user-avatar.role-director {
  --avatar-bg: var(--color-success);
}

.user-avatar.role-admin {
  --avatar-bg: #f59e0b;
}

.user-avatar.role-sadmin {
  --avatar-bg: var(--color-danger);
}

.user-avatar.role-unknown {
  --avatar-bg: #94a3b8;
}

.user-avatar.gender-male {
  --avatar-ring: #1d4ed8;
}

.user-avatar.gender-female {
  --avatar-ring: #ec4899;
}

.user-avatar.gender-unknown {
  --avatar-ring: rgba(148, 163, 184, 0.6);
}

.user-avatar.is-leaved {
  filter: grayscale(1);
  opacity: 0.55;
}

.user-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.user-avatar.has-image .user-avatar-image {
  display: block;
}

.user-avatar-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-avatar-initials::before {
  content: attr(data-initials);
}

.user-avatar.has-image .user-avatar-initials {
  opacity: 0;
}

.user-identity {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.user-identity--name-first {
  flex-direction: row-reverse;
}

.user-identity-text {
  line-height: 1.2;
}

.person-avatar-stack {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.person-avatar-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
  line-height: 0;
}

.person-avatar-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.avatar-tooltip {
  position: fixed;
  left: var(--tooltip-left, 0px);
  top: var(--tooltip-top, 0px);
  transform: translate(-50%, -100%) translateY(6px);
  opacity: 0;
  pointer-events: none;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 360px;
  text-align: left;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 1200;
}

.avatar-tooltip.is-visible {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(0);
}

.avatar-tooltip::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--color-surface);
  border-left: 1.25px solid var(--color-border);
  border-top: 1.25px solid var(--color-border);
  transform: rotate(45deg);
  bottom: -6px;
  left: var(--tooltip-arrow-left, 50%);
  margin-left: -5px;
}

.avatar-popover {
  position: fixed;
  left: var(--popover-left, 0px);
  top: var(--popover-top, 0px);
  transform: translate(-50%, -100%) translateY(6px);
  opacity: 0;
  pointer-events: none;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 350px;
  text-align: left;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 1200;
}

.avatar-popover.is-visible {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(0);
  pointer-events: auto;
}

.avatar-popover::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--color-surface);
  border-left: 1.25px solid var(--color-border);
  border-top: 1.25px solid var(--color-border);
  transform: rotate(45deg);
  bottom: -6px;
  left: var(--popover-arrow-left, 50%);
  margin-left: -5px;
}

.avatar-popover-content {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-3);
}

.avatar-popover-media {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-popover .user-avatar {
  --avatar-size: 96px;
  font-size: 1.47rem;
}

.avatar-popover-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.avatar-popover-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
  min-width: 0;
}

.avatar-popover-name {
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
}

.avatar-popover-status-message {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.avatar-popover-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.avatar-popover-action-icon {
  padding: 6px;
}

.avatar-popover-action-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.avatar-popover-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-border);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
}

.avatar-popover-status-dot.is-active {
  background: var(--color-success);
}

.avatar-popover-status-dot.is-leaved {
  background: var(--color-warning);
}

.avatar-popover-status-dot.is-inactive {
  background: #94a3b8;
}

.avatar-popover-status-dot.is-pending {
  background: var(--color-primary);
}

.avatar-popover-status-dot.is-unknown {
  background: var(--color-border);
}

.avatar-popover-role {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.avatar-popover-meta {
  display: grid;
  gap: 6px;
  margin-top: var(--space-2);
}

.avatar-popover-meta-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-2);
  align-items: baseline;
}

.avatar-popover-meta-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.avatar-popover-meta-value {
  font-size: 0.82rem;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.avatar-popover-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.avatar-popover-action {
  border: 1px solid var(--color-primary-200, #c7d2fe);
  background: var(--color-primary-50, #eef2ff);
  color: var(--color-primary-700, #4338ca);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.avatar-popover-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.18);
}

.avatar-popover-action:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.avatar-tooltip-content {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-3);
}

.avatar-tooltip-media {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-tooltip .user-avatar {
  --avatar-size: 96px;
  font-size: 1.47rem;
}

.avatar-tooltip-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.avatar-tooltip-name {
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.avatar-tooltip-role {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.user-avatar-modal-body {
  gap: var(--space-3);
}

.user-avatar-preview-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-neutral-soft);
}

.user-avatar-preview-card .user-avatar {
  --avatar-size: 96px;
  font-size: 1.1rem;
}

.user-avatar-field,
.user-avatar-target-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.user-avatar-file-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  cursor: pointer;
  align-self: flex-start;
}

.user-avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.user-avatar-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: 999px;
  padding: var(--space-3) var(--space-5);
  font: inherit;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  background: var(--color-surface);
  border: 1.25px solid var(--color-border);
  color: inherit;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast),
    color var(--transition-fast);
}

.user-avatar-file-icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.user-avatar-file-row:hover .user-avatar-file-button,
.user-avatar-file-row:focus-within .user-avatar-file-button {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  outline: none;
}

.user-avatar-file-input:disabled + .user-avatar-file-button {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.user-avatar-file-info {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

@media (max-width: 720px) {
  .user-avatar-preview-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

.tab-button.greeting-tab.greeting-status-available {
}

.tab-button.greeting-tab.greeting-status-upcoming {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.32);
}

.tab-button.greeting-tab.greeting-status-on-leave {
  background: rgba(239, 68, 68, 0.18);
  color: var(--color-danger, #b91c1c);
  border-color: rgba(239, 68, 68, 0.32);
}

.tab-button.greeting-tab.greeting-status-unknown {
  background: rgba(148, 163, 184, 0.16);
  color: var(--color-text-muted);
  border-color: rgba(148, 163, 184, 0.24);
}

.tab-button.greeting-tab:focus-visible {
  outline: none;
  box-shadow: none;
}

.account-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: var(--space-2);
  margin-left: auto;
  margin-right: 24px;
  --account-avatar-size: 50px;
}

.account-menu__avatar {
  width: var(--account-avatar-size);
  height: var(--account-avatar-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
}

.account-menu__avatar .user-avatar {
  --avatar-size: var(--account-avatar-size);
  font-size: 0.65rem;
}

.account-menu__avatar:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

@media (max-width: 1180px) {
  .account-menu .tab-button.greeting-tab {
    display: none;
  }
}

.account-menu__list {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-lg);
  padding: 6px 0;
  z-index: 40;
}

.account-menu__item {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  cursor: pointer;
}

.account-menu__item.is-active {
  font-weight: 600;
  color: #0f172a;
  background: rgba(59, 130, 246, 0.1);
}

.account-menu__item:hover,
.account-menu__item:focus-visible {
  background: #f3f4f6;
  outline: none;
}

.notification-inbox-trigger {
  position: relative;
}

.notification-inbox-trigger svg {
  width: 32px;
  height: 32px;
}

.notification-inbox-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #ffffff;
}
.tab-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.main-tabs {
  position: relative;
}

.main-tabs > .tab-pane {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  padding: var(--space-5);
  margin-top: var(--space-2);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.main-tabs > .tab-pane:not(.active) {
  box-shadow: none;
}

.main-tabs > .tab-pane.active {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  position: relative;
}

@media (min-width: 600px) {
  .main-tabs > .tab-pane {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  .main-tabs > .tab-pane.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--tab-arrow-left, 50%);
    transform: translate(-50%, -50%) rotate(45deg);
    width: 20px;
    height: 20px;
    border-radius: 1px;
    background: var(--color-surface);
    border-left: 1.25px solid var(--color-border-strong);
    border-top: 1.25px solid var(--color-border-strong);
    box-shadow: -6px -6px 18px rgba(15, 23, 42, 0.08);
  }
}

section {
  margin: 0;
}

section:not(.tab-pane):not(.settings-hub) {
  display: block;
}

#status {
  margin-top: var(--space-3);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  white-space: pre-line;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-pane article {
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface-subtle);
  box-shadow: var(--shadow-sm);
}

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

.audit-console-panel {
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 800px;
}

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

.audit-console-panel-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.audit-console-panel-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.audit-console-panel-actions .ghost-icon-button {
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.audit-console-settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 15;
}

.audit-console-settings-backdrop[hidden] {
  display: none;
}

.audit-console-settings-popover {
  position: absolute;
  top: calc(100% + var(--space-3));
  right: 0;
  width: min(450px, 90vw);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--color-surface);
  box-shadow: var(--shadow-xl);
  z-index: 20;
}

.audit-console-settings-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 1.5rem;
  width: 16px;
  height: 16px;
  background: inherit;
  border-top: 1.25px solid var(--color-border);
  border-left: 1.25px solid var(--color-border);
  transform: rotate(45deg);
}

.audit-console-settings-popover[hidden] {
  display: none;
}

.audit-console-settings-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.audit-console-stream {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  height: 700px;
  overflow: auto;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace);
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.audit-console-line {
  margin: 0 0 0.5rem;
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.audit-console-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.audit-console-line time {
  color: #94a3b8;
  min-width: 3.5rem;
  font-size: 0.75rem;
}

.audit-console-line pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-console-line.console-command pre {
  color: #38bdf8;
}

.audit-console-line.console-response pre {
  color: #4ade80;
}

.audit-console-line.console-system pre {
  color: #fbbf24;
}

.audit-console-line.console-log pre {
  color: #e2e8f0;
}

.audit-console-line.console-log-warning pre {
  color: #facc15;
}

.audit-console-line.console-log-error pre {
  color: #f87171;
}

.audit-console-details {
  margin-top: var(--space-2);
  border-left: 2px solid rgba(148, 163, 184, 0.4);
  padding-left: var(--space-3);
}

.audit-console-details summary {
  cursor: pointer;
  color: #7dd3fc;
  font-size: 0.75rem;
  margin-bottom: var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.audit-console-details[open] summary {
  color: #f8fafc;
}

.audit-console-details summary::before {
  content: "▶";
  font-size: 0.8rem;
  line-height: 1;
}

.audit-console-details[open] summary::before {
  content: "▼";
}

.audit-console-details-list {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  font-size: 0.75rem;
}

.audit-console-details-list dt {
  font-weight: var(--font-weight-semibold);
  color: #bae6fd;
}

.audit-console-details-list dd {
  margin: 0;
  color: #e2e8f0;
  word-break: break-word;
}

.audit-console-empty {
  color: #94a3b8;
  font-style: italic;
}

.audit-console-source-switch {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.audit-console-source-switch label {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  font-weight: var(--font-weight-semibold);
}

.audit-console-live-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  align-items: end;
}

.audit-console-auto-refresh {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
}

.auto-refresh-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-semibold);
}

.auto-refresh-switch input {
  width: auto;
}

.ghost-icon-button {
  border: none;
  background: transparent;
  font: inherit;
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.ghost-icon-button:hover,
.ghost-icon-button:focus-visible {
  color: var(--color-text);
  background: rgba(148, 163, 184, 0.2);
  outline: none;
}

.summary-list {
  margin: 0;
  display: grid;
  gap: var(--space-1);
}

.summary-list dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 0;
}

.summary-list dd {
  margin: 0 0 var(--space-2);
  font-weight: var(--font-weight-medium);
  font-size: 1rem;
  word-break: break-word;
}

.backup-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin: var(--space-4) 0;
}

.backup-custom-range {
  display: none;
  margin-top: var(--space-4);
}

.backup-custom-range[data-visible="true"] {
  display: block;
}

.log-container {
  margin-top: var(--space-4);
}

.log-container h4 {
  margin-bottom: var(--space-2);
}

.code-block {
  background: var(--color-surface-subtle);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  min-height: 72px;
  max-height: 240px;
  overflow-y: auto;
  font-family: var(--font-family-mono, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
  font-size: 0.9rem;
  white-space: pre-wrap;
  margin-bottom: 0px;
}

.summary-item-flex {
  display: flex;
  flex-direction: column;
}

.hash-badge {
  display: inline-block;
  max-width: 100%;
  padding: 0.25rem 0.5rem;
  background: rgba(37, 99, 235, 0.08);
  border: 1.25px solid rgba(37, 99, 235, 0.24);
  border-radius: var(--radius-md);
  font-family: var(--font-family-mono, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
  font-size: 0.85rem;
  word-break: break-all;
  white-space: normal;
}

.tab-content-placeholder {
  padding: var(--space-5);
  color: var(--color-text-muted);
  background: var(--color-neutral-soft);
  border-radius: var(--radius-lg);
}

.placeholder-block {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1.25px dashed var(--color-border);
  background: rgba(148, 163, 184, 0.12);
}

.performance-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.performance-filter-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.performance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.performance-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.performance-header h2 {
  margin: 0;
}

.performance-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
  min-width: auto;
}

.performance-controls-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.performance-filter-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 160px;
}
.performance-filter-field.period-control-field {
  min-width: auto;
}
.performance-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: auto;
  flex-wrap: wrap;
}

.performance-view-trigger-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: visible;
  z-index: 100;
}

.performance-view-trigger {
  border: 1.25px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  padding: 0.55rem 0.9rem;
  min-width: 120px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
  cursor: pointer;
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.performance-view-trigger:hover,
.performance-view-trigger:focus-visible {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.performance-view-popover {
  position: fixed;
  top: auto;
  left: auto;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-strong, #777b82);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow:
    0 14px 40px rgba(15, 23, 42, 0.3),
    0 12px 48px rgba(15, 23, 42, 0.16);
  min-width: 180px;
  max-width: 320px;
  width: auto;
  z-index: 200;
}

.performance-view-popover[hidden] {
  display: none;
}

.performance-view-popover .performance-view-toggle {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.performance-view-popover .performance-view-chip {
  justify-content: flex-start;
}

.performance-header-actions-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 100%;
}

.performance-view-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1.25px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
  order: 2;
  position: relative;
}

.performance-view-chip:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.performance-view-chip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.performance-view-chip__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}

.performance-view-chip__label {
  display: inline-block;
  white-space: nowrap;
}

.performance-view-chip[data-role="directors"] {
  --chip-color: #f97316;
  --chip-bg: rgba(249, 115, 22, 0.16);
}

.performance-view-chip[data-role="specialists"] {
  --chip-color: #2563eb;
  --chip-bg: rgba(37, 99, 235, 0.18);
}

.performance-view-chip[data-role="routing"] {
  --chip-color: #22c55e;
  --chip-bg: rgba(34, 197, 94, 0.18);
}

.performance-view-chip[data-role="directors"] .performance-view-chip__dot {
  background: var(--chip-color);
}

.performance-view-chip[data-role="specialists"] .performance-view-chip__dot {
  background: var(--chip-color);
}

.performance-view-chip:hover:not(.is-active):not(:disabled) {
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(148, 163, 184, 0.08);
  color: var(--color-heading);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.performance-view-chip[data-role="routing"] .performance-view-chip__dot {
  background: var(--chip-color);
}

.performance-view-chip.is-active {
  color: var(--chip-color);
  border-color: var(--chip-color);
  order: 1;
}

.performance-view-chip.is-active .performance-view-chip__label {
  display: inline;
}

.performance-view-chip::after,
.performance-view-chip::before {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.performance-view-chip::after {
  content: attr(aria-label);
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, 6px);
  background: var(--color-surface, #fff);
  border: 1.25px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-lg);
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  color: var(--color-heading);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  white-space: nowrap;
}

.performance-view-chip::before {
  content: "";
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translate(-50%, 4px);
  border-width: 6px;
  border-style: solid;
  border-color: transparent;
  border-bottom-color: rgba(15, 23, 42, 0.12);
}

.performance-view-chip:hover:not(:disabled)::after,
.performance-view-chip:focus-visible:not(:disabled)::after,
.performance-view-chip:hover:not(:disabled)::before,
.performance-view-chip:focus-visible:not(:disabled)::before {
  opacity: 1;
  transform: translate(-50%, 0);
}
.performance-filter-field select {
  min-width: 140px;
}

.performance-section-container {
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.performance-metrics-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.performance-period-label {
  font-weight: var(--font-weight-semibold);
}

.performance-period-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-start;
}

.performance-metrics-container .performance-snapshot-info {
  align-self: flex-end;
  margin-top: 0;
  font-size: 0.75rem;
  text-align: right;
}

.performance-highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin: var(--space-3) 0 var(--space-1);
}

.performance-highlight-card {
  background: var(--color-surface-subtle);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.performance-highlight-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  align-self: center;
}

.performance-highlight-value {
  font-size: 1.95rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
  align-self: center;
}

.performance-highlight-caption {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  align-self: center;
}

.performance-hub {
  margin-top: var(--space-2);
}

.performance-hub .settings-hub-sidebar {
  min-width: 260px;
  transition: width var(--transition-fast), padding var(--transition-fast);
}

.performance-hub .settings-hub-header {
  padding-right: 2.5rem;
}

.routing-config-badges {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.routing-config-badges .badge {
  background: #eef2ff;
  color: #1d4ed8;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid #e0e7ff;
}

.routing-config-flagbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.settings-hub.is-sidebar-collapsed .routing-config-badges,
.settings-hub.is-sidebar-collapsed .routing-config-flagbar,
.settings-hub.is-sidebar-collapsed .routing-mode-switch {
  display: none !important;
}

.routing-flag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #4b5563;
}

.routing-flag-chip.is-on {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #15803d;
  font-weight: 600;
}

.routing-flag-chip.is-off {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #94a3b8;
  opacity: 0.9;
}

.routing-mode-switch {
  display: inline-flex;
  gap: 6px;
  margin-top: 10px;
}

.routing-mode-btn {
  padding: 6px 10px;
  border: 1px solid #d4d4d8;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.routing-mode-btn.is-active {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.12);
}

.routing-mode-btn:hover {
  border-color: #c7d2fe;
}

.simple-routing-chart {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}

.simple-routing-legend {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #6b7280;
  align-items: center;
}

.simple-routing-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.simple-routing-label {
  font-weight: 600;
  color: #111827;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-routing-bar-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.simple-routing-bar {
  display: flex;
  height: 100%;
}

.simple-routing-segment {
  display: block;
  height: 100%;
}

.simple-routing-segment.load {
  background: #3b82f6;
}
.simple-routing-segment.reservation {
  background: #8b5cf6;
}
.simple-routing-segment.completed {
  background: #10b981;
}
.simple-routing-segment.rejected {
  background: #f59e0b;
}

.simple-routing-value {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: #4b5563;
  cursor: help;
}

.routing-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.performance-panel-card {
  scroll-margin-top: 96px;
}

.performance-nav-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-subtle);
  border: 1.25px solid rgba(148, 163, 184, 0.4);
  color: var(--color-text-muted);
  box-shadow: none;
}

.performance-nav-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

#directorOverviewPanel .performance-highlight-grid {
  margin-top: var(--space-3);
}

.performance-panel-card .settings-panel-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.performance-heatmap-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-x: auto;
}

.performance-heatmap-message {
  margin: 0;
  color: var(--color-text-muted);
}

.performance-heatmap-wrapper {
  display: flex;
  gap: var(--space-3);
  align-items: stretch;
  min-height: 240px;
}

.performance-heatmap-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 28px;
}

.performance-heatmap-grid {
  --heatmap-weeks: 1;
  display: grid;
  grid-template-rows: repeat(7, minmax(28px, 1fr));
  grid-auto-flow: column;
  grid-auto-columns: minmax(28px, 42px);
  gap: 6px;
}

.performance-heatmap-cell {
  position: relative;
  width: 100%;
  min-height: 32px;
  border-radius: var(--radius-sm);
  border: 1.25px solid rgba(148, 163, 184, 0.3);
  background-color: var(--color-surface-subtle);
  color: var(--color-heading);
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  text-align: center;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.performance-heatmap-cell:hover,
.performance-heatmap-cell:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.1);
  outline: none;
}

.performance-heatmap-cell.is-empty {
  border-style: dashed;
  color: var(--color-text-muted);
}

.performance-heatmap-cell.is-strong {
  color: #fff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

.performance-heatmap-legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.performance-heatmap-gradient {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    to right,
    rgba(234, 245, 238, 0.6),
    rgba(34, 197, 94, 0.85)
  );
}

.performance-backlog-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: stretch;
}

.performance-backlog-widget,
.performance-topdays-panel {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}








.backlog-sparkline {
  --chart-height-base: 220px;
  --chart-height-expanded: calc(var(--chart-height-base) * 1.5);
  min-height: var(--chart-height-base);
  height: var(--chart-height-base);
  position: relative;
  overflow: visible;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

.backlog-sparkline.is-expanded {
  min-height: var(--chart-height-expanded);
  height: var(--chart-height-expanded);
}

.backlog-sparkline canvas {
  width: 100%;
  height: 100% !important;
}

.backlog-sparkline.is-expanded canvas {
  height: 100% !important;
}

.performance-topdays-header h4 {
  margin: 0;
}

.performance-topdays-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.topday-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: var(--space-2);
  border-bottom: 1.25px dashed rgba(148, 163, 184, 0.4);
}

.topday-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.topday-label {
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topday-value {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.topday-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.performance-alerts-panel {
  margin-top: var(--space-4);
  border-top: 1.25px solid rgba(148, 163, 184, 0.3);
  padding-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.performance-alerts-panel h4 {
  margin: 0;
}

.performance-alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.alert-item {
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1.25px solid rgba(248, 113, 113, 0.45);
  font-size: 0.9rem;
  color: #b91c1c;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert-item strong {
  font-weight: var(--font-weight-semibold);
}

@media (max-width: 1024px) {
  .performance-backlog-layout {
    grid-template-columns: 1fr;
  }
}

.performance-hub.is-sidebar-collapsed {
  grid-template-columns: 112px minmax(0, 1fr);
}

.performance-hub.is-sidebar-collapsed .settings-hub-sidebar {
  max-width: 92px;
  min-width: 92px;
  width: 92px;
  padding: var(--space-4) var(--space-2);
}

.metric-delta {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  align-self: center;
}

.metric-delta--positive {
  color: var(--color-success, #166534);
}

.metric-delta--negative {
  color: var(--color-danger, #b91c1c);
}

.metric-delta--neutral {
  color: var(--color-text-muted);
}

.performance-subsection {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.performance-subsection h5 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-heading);
}

.support-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
}

.support-indicator.is-secondary {
  background: var(--color-neutral-soft);
  color: var(--color-text-muted);
}

.admin-log-section {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-log-heading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: nowrap;
  padding-bottom: 4px;
}

.admin-log-controls {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
  margin-left: auto;
  white-space: nowrap;
}

.admin-log-controls label {
  margin: 0;
  white-space: nowrap;
}

.admin-log-controls select {
  min-width: 140px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1.25px solid var(--color-border-subtle);
  font-size: 0.85rem;
  height: 2.1rem;
}

.admin-log-grid {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: stretch;
}

.admin-log-column {
  background: var(--color-surface-subtle);
  border: 1.25px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  padding-right: calc(var(--space-4) + 8px);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 640px;
  flex: 1 1 0;
  min-width: 200px;
  max-width: 100%;
  resize: horizontal;
  overflow: hidden;
  position: relative;
}

.admin-log-grid.is-resizing {
  cursor: col-resize;
}

.admin-log-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  z-index: 1;
}

.admin-log-resize-handle::after {
  content: "";
  width: 2px;
  height: 60%;
  background: var(--color-border-subtle);
  border-radius: var(--radius-pill);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.admin-log-resize-handle:hover::after,
.admin-log-resize-handle:active::after {
  opacity: 1;
}

.admin-log-column.is-resizing,
.admin-log-column.is-resizing * {
  user-select: none !important;
}

.admin-log-column-header {
  font-weight: var(--font-weight-semibold);
  font-size: 1rem;
}

.audit-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  max-height: 620px;
  overflow-y: auto;
  padding-right: var(--space-1);
}

.audit-log-item {
  background: var(--color-surface);
  border: 1.25px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.audit-log-item.audit-log-group {
  padding: 0;
}

.audit-log-item .audit-log-title {
  font-weight: var(--font-weight-medium);
  font-size: 0.95rem;
}

.audit-log-item .audit-log-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.audit-log-subitem .audit-log-title {
  font-weight: var(--font-weight-medium);
  font-size: 0.9rem;
}

.audit-log-subitem .audit-log-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.audit-log-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.audit-log-group-header:hover,
.audit-log-group-header:focus-visible {
  background: var(--color-surface-subtle);
  outline: none;
}

.audit-log-group-summary {
  flex: 1;
  font-weight: var(--font-weight-medium);
  font-size: 0.95rem;
}

.audit-log-group-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-right: var(--space-1);
}

.audit-log-group-caret {
  width: 0.75rem;
  height: 0.75rem;
  position: relative;
  flex-shrink: 0;
}

.audit-log-group-caret::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 0.25rem solid transparent;
  border-right: 0.25rem solid transparent;
  border-bottom: 0.4rem solid var(--color-text-muted);
  transition: transform 0.2s ease;
}

.audit-log-item.audit-log-group.is-expanded .audit-log-group-caret::before {
  transform: rotate(180deg);
}

.audit-log-sublist {
  list-style: none;
  margin: 0;
  padding: 0 var(--space-3) var(--space-3);
  display: none;
}

.audit-log-item.audit-log-group.is-expanded .audit-log-sublist {
  display: block;
}

.audit-log-subitem {
  padding-top: var(--space-3);
  margin-top: var(--space-3);
  border-top: 1.25px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.audit-log-subitem.is-first {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.operation-cost-overview-label {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.operation-cost-overview-value {
  margin: var(--space-1) 0;
  font-size: 1.05rem;
  font-weight: var(--font-weight-semibold);
}

.operation-cost-overview-meta {
  margin: 0;
}

.operation-cost-billing-detail {
  border: 1.25px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.operation-cost-billing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.operation-cost-billing-head h4,
.operation-cost-billing-head p {
  margin: 0;
}

.operation-cost-billing-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.operation-cost-cost-help {
  position: relative;
  flex: 0 0 auto;
}

.operation-cost-cost-help > summary {
  list-style: none;
}

.operation-cost-cost-help > summary::-webkit-details-marker {
  display: none;
}

.operation-cost-cost-help-trigger {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.78);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-heading);
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  user-select: none;
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.operation-cost-cost-help-trigger:hover,
.operation-cost-cost-help[open] .operation-cost-cost-help-trigger {
  border-color: rgba(37, 99, 235, 0.76);
  background: rgba(239, 246, 255, 0.94);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.operation-cost-cost-help-trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.9);
  outline-offset: 2px;
}

.operation-cost-cost-help-popover {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 30;
  width: min(430px, calc(100vw - 2rem));
  padding: var(--space-4);
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
}

.operation-cost-cost-help-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 12px;
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(148, 163, 184, 0.42);
  border-top: 1px solid rgba(148, 163, 184, 0.42);
  background: var(--color-surface);
  transform: rotate(45deg);
}

.operation-cost-cost-help-title {
  margin: 0 0 var(--space-3);
  color: var(--color-heading);
  font-size: 0.92rem;
  font-weight: var(--font-weight-semibold);
}

.operation-cost-cost-help-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.operation-cost-cost-help-list > div {
  display: grid;
  grid-template-columns: minmax(4.5rem, 0.34fr) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.operation-cost-cost-help-list dt {
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
}

.operation-cost-cost-help-list dd {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.operation-cost-cost-help-note {
  margin: var(--space-3) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.operation-cost-cumulative-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-size: 0.86rem;
  white-space: nowrap;
  padding-bottom: 0px;
}

.operation-cost-billing-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.operation-cost-billing-summary-item {
  padding: var(--space-3);
  min-height: 92px;
  background: var(--color-surface);
}

.operation-cost-billing-summary-item + .operation-cost-billing-summary-item {
  border-left: 1px solid var(--color-border-subtle);
}

.operation-cost-billing-chart-wrap {
  overflow-x: auto;
  padding-bottom: var(--space-1);
}

.operation-cost-billing-chart {
  min-height: 260px;
  min-width: 720px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(28px, 1fr);
  align-items: end;
  gap: 0.45rem;
  padding: var(--space-3) var(--space-2) var(--space-2);
  border-bottom: 1px solid rgba(100, 116, 139, 0.48);
  background:
    linear-gradient(to top, rgba(148, 163, 184, 0.28) 1px, transparent 1px) 0 0 / 100% 33.33%,
    var(--color-surface);
}

.operation-cost-billing-day {
  min-width: 0;
  height: 220px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.35rem;
  align-items: end;
}

.operation-cost-billing-bar {
  width: 100%;
  min-height: 2px;
  height: var(--bar-height, 0%);
  align-self: end;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
  background: rgba(226, 232, 240, 0.85);
}

.operation-cost-billing-bar.is-empty {
  min-height: 2px;
  background: rgba(203, 213, 225, 0.5);
}

.operation-cost-billing-segment {
  width: 100%;
  min-height: 2px;
  height: var(--segment-height, 0%);
  background: var(--segment-color, #3b82f6);
  transition:
    opacity 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.14s ease;
}

.operation-cost-billing-segment.is-forecast {
  background: rgba(203, 213, 225, 0.9);
}

.operation-cost-billing-day-label {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.table-container.operation-cost-billing-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: clamp(240px, 100dvh, 1420px);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}

.operation-cost-billing-table {
  min-width: 960px;
  table-layout: fixed;
}

.operation-cost-billing-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--color-surface);
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.42);
}

.operation-cost-billing-table th,
.operation-cost-billing-table td {
  vertical-align: top;
  padding: 0.58rem 0.72rem;
  line-height: 1.35;
}

.operation-cost-billing-table th:nth-child(1),
.operation-cost-billing-table td:nth-child(1) {
  width: 39%;
  min-width: 340px;
}

.operation-cost-billing-table th:nth-child(2),
.operation-cost-billing-table td:nth-child(2) {
  width: 22%;
}

.operation-cost-billing-table th:nth-child(3),
.operation-cost-billing-table td:nth-child(3),
.operation-cost-billing-table th:nth-child(4),
.operation-cost-billing-table td:nth-child(4),
.operation-cost-billing-table th:nth-child(5),
.operation-cost-billing-table td:nth-child(5) {
  width: 13%;
}

.operation-cost-billing-table th:first-child,
.operation-cost-billing-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-surface);
}

.operation-cost-billing-table th:first-child {
  z-index: 4;
}

.operation-cost-billing-sku {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.operation-cost-billing-sku-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex: 0 0 0.55rem;
  margin-top: 0.32rem;
  background: var(--segment-color, #64748b);
}

.operation-cost-billing-sku-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
}

.operation-cost-billing-sku-name {
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
}

.operation-cost-billing-sku-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  color: var(--color-text-muted);
  font-size: 0.74rem;
}

.operation-cost-billing-service-pill,
.operation-cost-billing-change {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.85);
  color: var(--color-heading);
  padding: 0.08rem 0.42rem;
  font-size: 0.72rem;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.operation-cost-billing-group-row td {
  background: rgba(248, 250, 252, 0.96);
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold);
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.operation-cost-billing-group-row td:first-child {
  background: rgba(248, 250, 252, 0.96);
}

.operation-cost-billing-group-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.operation-cost-billing-group-label .operation-cost-billing-sku-dot {
  margin-top: 0;
}

.operation-cost-billing-group-count {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.operation-cost-billing-table .number-cell {
  text-align: right;
  white-space: nowrap;
}

.operation-cost-billing-usage-cell,
.operation-cost-billing-net-cell {
  text-align: right;
}

.operation-cost-billing-usage-value,
.operation-cost-billing-net-value {
  display: block;
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
}

.operation-cost-billing-usage-primary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
  max-width: 100%;
}

.operation-cost-billing-usage-primary .operation-cost-billing-usage-value {
  display: inline;
}

.operation-cost-billing-usage-free {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  white-space: nowrap;
}

.operation-cost-billing-usage-free.is-empty {
  min-width: 0;
  cursor: default;
}

.operation-cost-billing-free-ring {
  --free-tier-pct: 0;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--color-surface) 0 54%, transparent 55%),
    conic-gradient(#16a34a calc(var(--free-tier-pct) * 1%), rgba(226, 232, 240, 0.96) 0);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.operation-cost-billing-usage-free:focus-visible .operation-cost-billing-free-ring {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

.operation-cost-billing-free-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 30;
  width: min(280px, 70vw);
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  color: var(--color-text);
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.15rem);
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

.operation-cost-billing-usage-free:hover .operation-cost-billing-free-popover,
.operation-cost-billing-usage-free:focus .operation-cost-billing-free-popover,
.operation-cost-billing-usage-free:focus-within .operation-cost-billing-free-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.operation-cost-billing-free-popover-title {
  color: var(--color-heading);
  font-size: 0.78rem;
  font-weight: var(--font-weight-bold, 700);
}

.operation-cost-billing-free-popover-row {
  display: grid;
  grid-template-columns: minmax(5.8rem, auto) 1fr;
  gap: 0.45rem;
  align-items: start;
  color: var(--color-text);
  font-size: 0.72rem;
  line-height: 1.35;
}

.operation-cost-billing-free-popover-label,
.operation-cost-billing-free-popover-note {
  color: var(--color-text-muted);
}

.operation-cost-billing-free-popover-row strong {
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
}

.operation-cost-billing-free-popover-note {
  padding-top: 0.22rem;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 0.7rem;
  line-height: 1.35;
}

.operation-cost-billing-usage-raw {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.operation-cost-billing-credit-cell {
  color: #047857;
}

.operation-cost-billing-sku-row {
  transition:
    background-color 0.14s ease,
    box-shadow 0.14s ease;
}

.operation-cost-billing-sku-row.is-highlighted {
  background: rgba(66, 133, 244, 0.09);
  box-shadow: inset 3px 0 0 rgba(66, 133, 244, 0.9);
}

.operation-cost-billing-sku-row.is-highlighted td:first-child {
  background: rgba(239, 246, 255, 0.98);
}

.operation-cost-billing-sku-row:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.9);
  outline-offset: -2px;
}

.operation-cost-billing-detail[data-operation-cost-highlight]
  .operation-cost-billing-segment[data-operation-cost-billing-key] {
  opacity: 0.24;
  filter: saturate(0.62);
}

.operation-cost-billing-detail[data-operation-cost-highlight]
  .operation-cost-billing-segment[data-operation-cost-billing-key].is-highlighted {
  opacity: 1;
  filter: none;
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.32),
    0 0 0 2px rgba(66, 133, 244, 0.18);
}

.operation-cost-panel-header {
  align-items: flex-start;
  flex-direction: row;
}

.operation-cost-range-toolbar {
  flex: 0 1 32rem;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

@media (max-width: 760px) {
  .operation-cost-billing-head {
    flex-direction: column;
  }

  .operation-cost-billing-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .operation-cost-cost-help-popover {
    left: 0;
    right: auto;
  }

  .operation-cost-cost-help-popover::before {
    right: auto;
    left: 12px;
  }

  .operation-cost-billing-summary-item + .operation-cost-billing-summary-item {
    border-left: none;
    border-top: 1px solid var(--color-border-subtle);
  }
}

.operation-cost-range-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  white-space: nowrap;
}

.operation-cost-range-actions .compact-button,
.operation-cost-range-panel .compact-button {
  min-height: 2rem;
  padding: 0.32rem 0.75rem;
}

.operation-cost-range-panel {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.65rem;
  padding: var(--space-3);
  border: 1.25px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.operation-cost-range-panel[hidden] {
  display: none;
}

.operation-cost-range-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(8.75rem, 1fr));
  gap: 0.55rem;
}

.operation-cost-range-panel .chat-ai-ops-control-field {
  min-width: 0;
  gap: 0.2rem;
}

.operation-cost-range-panel .chat-ai-ops-control-field > label.small-text {
  font-size: 0.78rem;
  line-height: 1.1;
}

.operation-cost-range-panel .chat-ai-ops-control-field input[type="date"] {
  height: 2rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.92rem;
  border-radius: 999px;
}

.chat-ai-ops-section {
  margin-top: var(--space-4);
  border: 1.25px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-surface-subtle);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chat-ai-ops-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chat-ai-ops-heading h4 {
  margin: 0;
}

.chat-ai-ops-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2);
}

.chat-ai-ops-controls-main {
  flex: 1 1 350px;
  min-width: 220px;
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: var(--space-2) var(--space-3);
}

.chat-ai-ops-control-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-ai-ops-control-field > label.small-text {
  margin: 0;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  line-height: 1.2;
}

.chat-ai-ops-control-field select,
.chat-ai-ops-control-field input[type="date"],
.chat-ai-ops-control-field input[type="number"] {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 2.2rem;
}

.chat-ai-ops-control-field select {
  padding: 0.32rem 1.85rem 0.32rem 0.58rem;
  background-position: right 0.52rem center;
}

.chat-ai-ops-control-field input#chatAiOpsProviderActualCost {
  min-width: 0;
  max-width: none;
}

.chat-ai-ops-control-field--toggle {
  justify-content: flex-end;
  padding-bottom: 0.18rem;
}

.chat-ai-ops-toggle {
  margin: 0;
  min-height: 2.2rem;
}

.chat-ai-ops-advanced-popover {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
}

.chat-ai-ops-advanced-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.32rem 0.95rem;
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.chat-ai-ops-advanced-toggle::-webkit-details-marker {
  display: none;
}

.chat-ai-ops-advanced-toggle::marker {
  content: "";
}

.chat-ai-ops-advanced-popover[open] .chat-ai-ops-advanced-toggle {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.chat-ai-ops-advanced-toggle:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.chat-ai-ops-advanced-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 20;
  width: min(520px, calc(100vw - 3rem));
  border: 1.25px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chat-ai-ops-advanced-popover:not([open]) .chat-ai-ops-advanced-panel {
  display: none;
}

.chat-ai-ops-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: var(--space-2) var(--space-3);
  align-items: end;
}

.chat-ai-ops-advanced-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chat-ai-ops-actions {
  display: flex;
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chat-ai-ops-actions .secondary-button {
  min-width: 9rem;
}

.chat-ai-ops-filter-summary {
  flex: 1 0 100%;
  margin: 0;
}

.chat-ai-ops-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-2);
}

.chat-ai-ops-summary-item {
  background: var(--color-surface);
  border: 1.25px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.chat-ai-ops-summary-label {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.chat-ai-ops-summary-value {
  margin: var(--space-1) 0 0;
  font-size: 1.12rem;
  font-weight: var(--font-weight-semibold);
}

.chat-ai-ops-status.is-error {
  color: var(--color-danger, #dc2626);
}

.chat-ai-ops-reconciliation {
  margin: 0;
}

.chat-ai-ops-pilot {
  margin: 0;
}

.chat-ai-ops-pilot-reviews-status {
  margin: 0;
}

.chat-ai-ops-pilot-reviews-status.is-error {
  color: var(--color-danger, #dc2626);
}

.chat-ai-ops-alerts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-2);
}

.chat-ai-ops-alert-item {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-2) var(--space-3);
  font-size: 0.86rem;
}

.chat-ai-ops-alert-item.is-ok {
  border-color: rgba(22, 163, 74, 0.22);
  color: #166534;
}

.chat-ai-ops-alert-item.is-warning {
  border-color: rgba(249, 115, 22, 0.3);
  color: #c2410c;
}

.chat-ai-ops-alert-item.is-critical {
  border-color: rgba(220, 38, 38, 0.28);
  color: #b91c1c;
}

.chat-ai-ops-table-wrap {
  border: 1.25px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: auto;
  background: var(--color-surface);
}

.chat-ai-ops-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.chat-ai-ops-table th,
.chat-ai-ops-table td {
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 0.55rem 0.75rem;
  text-align: left;
  white-space: nowrap;
}

.chat-ai-ops-table th {
  font-weight: var(--font-weight-semibold);
  background: rgba(15, 23, 42, 0.04);
}

@media (max-width: 760px) {
  .chat-ai-ops-controls {
    align-items: stretch;
  }

  .chat-ai-ops-controls-main {
    grid-template-columns: 1fr;
    flex: 1 1 100%;
  }

  .chat-ai-ops-advanced-popover {
    width: 100%;
  }

  .chat-ai-ops-advanced-toggle {
    width: 100%;
  }

  .chat-ai-ops-control-field--toggle {
    justify-content: flex-start;
  }

  .chat-ai-ops-advanced-panel {
    position: static;
    width: 100%;
    margin-top: var(--space-2);
    box-shadow: none;
  }

  .chat-ai-ops-advanced-grid {
    grid-template-columns: 1fr;
  }

  .chat-ai-ops-advanced-actions {
    justify-content: stretch;
  }

  .chat-ai-ops-advanced-actions button {
    flex: 1 1 100%;
    min-width: 0;
  }

  .chat-ai-ops-actions {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .chat-ai-ops-actions .secondary-button {
    flex: 1 1 100%;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .operation-cost-panel-header {
    flex-direction: column;
  }

  .operation-cost-range-toolbar {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  .operation-cost-range-toolbar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    flex: 0;
  }

  .operation-cost-range-actions {
    width: 100%;
  }

  .operation-cost-range-actions .compact-button {
    flex: 1 1 0;
  }

  .operation-cost-range-panel {
    grid-template-columns: 1fr;
    margin-top: 0.5rem;
  }

  .operation-cost-range-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .chat-ai-ops-controls-main {
    grid-template-columns: 1fr;
  }

  .chat-ai-ops-actions {
    margin-left: 0;
  }

  .chat-ai-ops-advanced-panel {
    right: auto;
    left: 0;
  }
}

.danger-text {
  color: var(--color-danger, #b91c1c);
}

.admin-support-toggle {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 8px;
  cursor: pointer;
}

.align-left {
  text-align: left;
}

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


.performance-table th,
.performance-table td {
  border: 1.25px solid var(--color-border);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.performance-table col.is-column-hidden {
  display: none;
}

.performance-table th.is-column-hidden,
.performance-table td.is-column-hidden {
  display: none;
}

.performance-table tr.performance-row-summary {
  background: var(--color-surface-subtle);
  font-weight: var(--font-weight-semibold);
}

.performance-table tr.performance-row-summary td {
  border-top: 2px solid var(--color-border);
}

.performance-table tbody tr.performance-zero-group-row {
  cursor: pointer;
  background: var(--color-surface-subtle);
  font-weight: var(--font-weight-semibold);
}

.performance-table tbody tr.performance-zero-group-row:hover {
  background: var(--color-surface);
}

.performance-table tbody tr.performance-zero-group-row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.performance-table tbody tr.performance-zero-group-row.is-expanded {
  background: var(--color-primary-soft);
}

.performance-table td.cell-warning,
.performance-table td.cell-critical {
  font-weight: var(--font-weight-semibold);
}

.performance-table td.cell-warning {
  color: var(--color-danger);
}

.performance-table td.cell-critical {
  color: var(--color-danger-hover);
}

.performance-table tbody tr.performance-expandable-row {
  cursor: pointer;
  transition: background var(--transition-base);
}

.performance-table tbody tr.performance-expandable-row:hover {
  background: var(--color-surface-subtle);
}

.performance-table tbody tr.performance-expandable-row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.performance-table tbody tr.performance-expandable-row.is-expanded {
  background: var(--color-primary-soft);
}

.performance-detail-row td {
  background: var(--color-surface);
  padding: var(--space-4);
  border: 1.25px solid var(--color-border);
  border-top: none;
}

.performance-detail-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.performance-detail-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.performance-detail-item {
  background: var(--color-surface-subtle);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.performance-detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.performance-detail-value {
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.performance-detail-caption {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.performance-detail-item.cell-warning .performance-detail-value {
  color: var(--color-danger);
}

.performance-detail-item.cell-critical .performance-detail-value {
  color: var(--color-danger-hover);
}

.performance-summary-label {
  font-weight: var(--font-weight-semibold);
}

.performance-corner-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 72px;
  background: var(--color-surface-subtle);
  padding: var(--space-3) var(--space-4);
  text-align: left;
}

.performance-corner-header .corner-label {
  display: block;
  white-space: nowrap;
  line-height: 1.2;
}

.performance-corner-header .corner-label-top {
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.performance-corner-header .corner-label-bottom {
  align-self: flex-end;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.performance-table th {
  background: var(--color-surface-subtle);
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  min-height: 64px;
  vertical-align: middle;
  padding: var(--space-3) var(--space-2);
}

.performance-table th:first-child,
.performance-table td:first-child {
  width: 180px;
  min-width: 180px;
  text-align: left;
  padding-left: var(--space-4);
}

.performance-table th:first-child .performance-header-wrapper {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: var(--space-1);
}

.performance-table th.performance-corner-header,
.performance-table th.performance-corner-header:first-child {
  padding: var(--space-3) var(--space-4);
}

.performance-header-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  text-align: center;
}

.performance-header-text {
  white-space: normal;
  line-height: 1.2;
}

.performance-header-help {
  transform: none;
  margin-top: var(--space-1);
}

.performance-footnote {
  font-size: 0.85rem;
}

.performance-chart-wrapper {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.performance-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: flex-start;
}

.performance-chart-layout > * {
  min-width: 0;
}

#directorProgressPanel,
#directorProgressPanel .settings-panel-body,
#directorProgressPanel .performance-chart-layout {
  overflow: visible;
}

#directorProgressPanel {
  padding-bottom: var(--space-1);
}

.performance-chart-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.performance-chart-header h4 {
  margin: 0;
}

.performance-chart-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.performance-backlog-inline {
  margin-top: 0;
  min-width: 0;
}

.performance-chart-canvas {
  width: 100%;
  position: relative;
  min-height: clamp(320px, 45vh, 640px);
  height: clamp(320px, 45vh, 640px);
  overflow: visible;
  min-width: 0;
}

.performance-chart-canvas--progress {
  height: clamp(320px, 45vh, 640px);
}

.performance-chart-canvas--intake {
  min-height: clamp(160px, 22vh, 320px);
  height: clamp(160px, 22vh, 320px);
}

.performance-chart-canvas--pressure {
  min-height: clamp(200px, 26vh, 360px);
  height: clamp(200px, 26vh, 360px);
}

.performance-chart-footnote {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) var(--space-1) var(--space-1);
  padding-right: var(--space-2);
}

.performance-chart-footnote .small-text {
  line-height: 1.4;
}

.performance-chart-tooltip {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

#directorProgressPanel .performance-chart-canvas {
  height: auto;
}

.performance-chart-canvas canvas {
  width: 100% !important;
} 

#directorLoadSlaChartCanvasWrapper {
  min-height: 0;
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

#directorLoadSlaChartWrapper {
  position: relative;
  width: 100%;
  height: clamp(240px, 32vh, 360px);
  min-height: 240px;
  max-height: 360px;
  overflow: hidden;
}

#directorLoadSlaChart {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 100%;
}

#directorLoadSlaChartCanvasWrapper .small-text {
  margin: 0;
}


#directorChartCanvasWrapper {
  --chart-height-base: clamp(700px, 45vh, 900px);
  --chart-height-expanded: calc(var(--chart-height-base) * 1.5);
  --director-chart-filter-space: 58px;
  min-height: var(--chart-height-base);
  height: auto;
  padding-top: var(--director-chart-filter-space);
}

#directorChartCanvasWrapper.is-expanded {
  min-height: var(--chart-height-expanded);
}

#directorChartCanvasWrapper > canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#directorChartCanvasWrapper.is-expanded > canvas {
  height: 100% !important;
}

.chart-toggleable {
  position: relative;
  padding-top: 48px;
  min-height: 100%;
}

.chart-toggle-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1.25px solid rgba(37, 99, 235, 0.35);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: rgba(15, 23, 42, 0.8);
  font-size: 0.8rem;
  padding: 4px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-base), border var(--transition-base);
  z-index: 2;
}

.chart-toggle-chip::before {
  content: "⤢";
  font-size: 0.85rem;
  line-height: 1;
}

.chart-toggle-chip:focus-visible,
.chart-toggle-chip:hover {
  border-color: rgba(37, 99, 235, 0.6);
  background: rgba(37, 99, 235, 0.18);
}

.director-chart-filter-bar {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 118px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.director-chart-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 260px;
  color: rgba(71, 85, 105, 0.9);
  font-size: 0.78rem;
  font-weight: 700;
}

.director-chart-filter span {
  white-space: nowrap;
}

.director-chart-filter select {
  min-width: 112px;
  max-width: min(220px, 48vw);
  height: 30px;
  border: 1.25px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: rgba(15, 23, 42, 0.88);
  font-size: 0.8rem;
  padding: 3px 28px 3px 10px;
}

.director-chart-filter-summary {
  min-width: 0;
  color: rgba(100, 116, 139, 0.95);
  font-size: 0.78rem;
  line-height: 1.25;
}

@media (max-width: 1180px) {
  #directorChartCanvasWrapper {
    --director-chart-filter-space: 96px;
  }
}

@media (max-width: 900px) {
  #directorChartCanvasWrapper {
    --director-chart-filter-space: 176px;
  }

  .director-chart-filter-bar {
    top: 44px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  #directorChartCanvasWrapper {
    --director-chart-filter-space: 214px;
  }

  .director-chart-filter {
    width: 100%;
    max-width: none;
  }

  .director-chart-filter select {
    flex: 1 1 auto;
    max-width: none;
  }
}

.chart-empty-message {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  text-align: center;
  max-width: 360px;
}

.performance-contribution-section {
  margin-top: var(--space-7);
}

.performance-backlog-layout .performance-contribution-section {
  margin-top: 0;
}

.performance-contribution-header h4 {
  margin: 0 0 var(--space-2);
}

.performance-treemap-wrapper {
  position: relative;
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-subtle);
  min-height: clamp(360px, 55vh, 720px);
  height: clamp(360px, 55vh, 720px);
  overflow: hidden;
}

.performance-treemap-grid {
  position: relative;
  width: 100%;
  height: 100%;
}

.performance-treemap-tile {
  position: absolute;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  color: #0f172a;
  font-weight: 600;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: none;
  background: transparent;
  cursor: default;
  text-align: left;
  min-height: 36px;
}

.performance-treemap-tile:hover,
.performance-treemap-tile:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.performance-treemap-tile:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 2px;
}

.performance-treemap-trend {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.performance-treemap-trend::before {
  content: attr(data-arrow);
}

.performance-treemap-trend.is-trend-up {
  background: var(--treemap-trend-up-bg);
  color: var(--treemap-trend-up-fg);
}

.performance-treemap-trend.is-trend-down {
  background: var(--treemap-trend-down-bg);
  color: var(--treemap-trend-down-fg);
}

.performance-treemap-trend.is-trend-flat {
  background: var(--treemap-trend-flat-bg);
  color: var(--treemap-trend-flat-fg);
}

.treemap-pressure {
  margin-top: var(--space-1);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #f8fafc;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.35);
  border: 1.25px solid transparent;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
}

.treemap-pressure--high {

}

.treemap-pressure--medium {

}

.treemap-pressure--low {

}

.treemap-motivation {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: inherit;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.35);
}

.performance-treemap-label {
  font-size: 0.9rem;
  line-height: 1.2;
}

.performance-treemap-value {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.9;
}

.performance-treemap-forecast {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

.performance-treemap-tile.is-condensed .performance-treemap-label,
.performance-treemap-tile.is-condensed .performance-treemap-value {
  font-size: 0.75rem;
}

.performance-treemap-tile.is-condensed .performance-treemap-trend {
  display: none;
}

.performance-treemap-tile.is-condensed .performance-treemap-forecast {
  display: none;
}

.kpi-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  height: 0.85rem;
  margin-left: var(--space-1);
  border-radius: 50%;
  border: 1.25px solid rgba(148, 163, 184, 0.9);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.55rem;
  line-height: 0.85rem;
  padding: 0;
  box-sizing: border-box;
  vertical-align: middle;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

.kpi-help:hover,
.kpi-help:focus-visible {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.16);
  color: var(--color-primary);
  outline: none;
}

.kpi-tooltip {
  position: absolute;
  max-width: 260px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.25px solid var(--color-border-strong, var(--color-border));
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  z-index: 3000;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.performance-section {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.performance-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.performance-section-header h4 {
  margin: 0;
}

.performance-section-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.settings-panel-header .performance-section-controls {
  align-self: center;
}

.performance-section:first-of-type {
  margin-top: 0;
}

.performance-section.priority-ranking-section {
  margin-top: var(--space-7);
}

.performance-section h4 {
  margin: 0;
}

fieldset {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}

legend {
  padding: 0 var(--space-2);
  font-weight: var(--font-weight-semibold);
}

.group-checkbox-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: var(--space-3);
}

.group-checkbox-grid--scrollable {
  max-height: 260px;
  overflow-y: auto;
  padding-right: var(--space-2);
}

.group-checkbox-grid label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-2) var(--space-3);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
}

.group-checkbox-grid input[type="checkbox"] {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.group-checkbox-grid label:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.group-checkbox-grid label.is-selected {
  border-color: var(--color-primary);
}

.group-checkbox-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-checkbox-code {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.group-checkbox-name {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.group-checkbox-grid input[type="checkbox"]:checked + .group-checkbox-meta {
  color: var(--color-heading);
}

.group-checkbox-grid input[type="checkbox"]:checked + .group-checkbox-meta .group-checkbox-code {
  color: var(--color-primary);
}

.group-checkbox-grid input[type="checkbox"]:checked + .group-checkbox-meta .group-checkbox-name {
  color: var(--color-primary);
  opacity: 0.8;
}

.group-selection-hint {
  margin: var(--space-2) 0 0;
}

.flex-row {
  display: flex;
  gap: var(--space-4);
  align-items: flex-end;
}

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

.flex-row.align-center {
  align-items: center;
}

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

.submit-modal-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.submit-modal-flow-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: stretch;
}

.submit-modal-flow-row .submit-modal-card {
  flex: 1 1 320px;
  min-width: 280px;
}

.submit-modal-dialog {
  width: min(700px, 96vw);
}

.submit-modal-card {
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--color-surface-alt);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.submit-modal-card__header {
  margin-bottom: var(--space-3);
}

.submit-modal-card__title-row,
.manual-group-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.submit-modal-tooltip {
  margin-top: 1px;
}

.submit-modal-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.submit-modal-card__hint {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.submit-modal-two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
}

.manual-director-container.submit-modal-card {
  background: var(--color-surface);
}

.manual-group-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Inline attachments inside submit modal card */
.submit-inline-attachments {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.submit-inline-attachments-summary {
  margin: 0;
}

.submit-inline-attachments-dropzone {
  min-height: 100px;
}

.submit-inline-attachments-hint {
  margin: 0;
  font-size: 0.8rem;
}

.submit-inline-attachments-list {
  max-height: 240px;
  overflow: auto;
}

/* Compact submit-attachments-staging when inside modal card */
.submit-inline-attachments .attachments-staging-list {
  max-height: 220px;
}

.submit-inline-attachments-dropzone.is-dragover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.submit-modal-dialog {
  width: min(760px, 96vw);
}

.manual-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.manual-group-control {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.manual-group-control select {
  flex: 1 1 auto;
}

.manual-group-label {
  flex: 1 1 auto;
  min-width: 0;
}

.manual-group-title,
.manual-group-subtitle {
  margin: 0;
}

.manual-group-title {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.manual-group-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.manual-group-header .manual-toggle-wrapper {
  margin-left: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.manual-toggle-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  border-width: 1px;
  border: 1.25px solid var(--color-border);
  color: #059669;
  white-space: nowrap;
  margin-top: 4px;
  align-self: flex-end;
}

.manual-toggle-label {
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-heading);
  white-space: nowrap;
}

.manual-toggle-control {
  width: auto;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-3);
}

.manual-toggle-control .toggle-switch-label {
  order: 0;
  flex: 0 0 auto;
}

.manual-toggle-control .toggle-switch-track {
  order: 1;
}

.manual-toggle-row .toggle-switch {
  flex-shrink: 0;
}

.manual-toggle-status[data-mode="manual"] {
  color: #c2410c;
  border: 1.25px solid var(--color-border);

}

.manual-toggle-status[data-mode="disabled"] {
  background: rgba(148, 163, 184, 0.2);
  color: var(--color-text-muted);
}

@media (max-width: 560px) {
  .manual-group-header {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 0;
  }
  .manual-group-field {
    padding-right: 0;
  }
  .manual-group-label {
    width: 100%;
  }
  .manual-group-control {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
.manual-group-header .manual-toggle-wrapper {
  margin-left: 0;
  width: 100%;
  justify-content: flex-start;
  min-width: 0;
}
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.toggle-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-switch .toggle-switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  background: radial-gradient(circle at 78% 50%, rgba(255, 255, 255, 0.85) 7px, rgba(210, 216, 228, 0.3) 9px, rgba(210, 216, 228, 0) 12px),
    #e4e9f2;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.toggle-switch .toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-switch-track {
  background: linear-gradient(120deg, #1e64f0, #4c8efd);
  box-shadow: inset 0 1px 5px rgba(15, 23, 42, 0.2);
}

.toggle-switch input:checked + .toggle-switch-track .toggle-switch-thumb {
  transform: translateX(28px);
  box-shadow: 0 6px 12px rgba(30, 100, 240, 0.4);
}

.toggle-switch.toggle-switch--inline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
  width: auto;
  max-width: 100%;
  flex-wrap: nowrap;
}

.toggle-switch.toggle-switch--inline input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.toggle-switch.toggle-switch--inline .toggle-switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  flex: 0 0 56px;
}

.toggle-switch.toggle-switch--inline .toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
  transform: translateX(0);
  transition: transform var(--transition-fast);
}

.toggle-switch.toggle-switch--inline input:focus-visible + .toggle-switch-track {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.toggle-switch.toggle-switch--inline input:checked + .toggle-switch-track {
  background: linear-gradient(120deg, #1e64f0, #4c8efd);
  box-shadow: inset 0 1px 5px rgba(15, 23, 42, 0.2);
}

.toggle-switch.toggle-switch--inline input:checked + .toggle-switch-track .toggle-switch-thumb {
  transform: translateX(28px);
  box-shadow: 0 6px 12px rgba(30, 100, 240, 0.4);
}

.toggle-switch.toggle-switch--inline input:disabled + .toggle-switch-track {
  background: var(--color-border);
}

.toggle-switch-label {
  font-size: 0.95rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  white-space: normal;
  line-height: 1.3;
}

.toggle-switch.toggle-switch--inline .toggle-switch-label {
  flex: 0 1 auto;
  min-width: 0;
  word-break: break-word;
  order: 1;
  margin-right: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.toggle-switch.toggle-switch--inline input:disabled ~ .toggle-switch-label,
.toggle-switch input:disabled ~ .toggle-switch-label {
  color: var(--color-text-muted);
}

.toggle-switch.toggle-switch--inline .toggle-switch-track {
  margin-left: 0;
  flex: 0 0 auto;
  order: 2;
  margin-left: auto;
}

.toggle-switch.toggle-switch--inline.toggle-switch--track-first .toggle-switch-track {
  order: 0;
}

.toggle-switch.toggle-switch--inline.toggle-switch--track-first .toggle-switch-label {
  order: 1;
}

.manual-group-field.manual-enabled select {
  background: var(--color-surface-subtle);
  font-weight: var(--font-weight-medium);
}

.specialist-secondary-inputs {
  flex-wrap: wrap;
}

.specialist-secondary-inputs .company-field {
  flex: 2 1 320px;
  min-width: 260px;
}

.specialist-secondary-inputs .cif-field {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 260px;
}

.flex-1 {
  flex: 1;
}

.gap-sm {
  gap: var(--space-2);
}

.gap-lg {
  gap: var(--space-6);
}

.mt-3 {
  margin-top: var(--space-3);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mb-3 {
  margin-bottom: var(--space-3);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-5 {
  margin-bottom: var(--space-5);
}

.summary-filters,
.history-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin: var(--space-2) 0 var(--space-3);
}

.summary-filters .period-inline-field {
  align-self: end;
}

.history-filters .period-inline-field {
  align-self: end;
}

.summary-filters .action-field {
  align-self: end;
}

.summary-action-buttons {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.summary-action-buttons .primary-button,
.summary-action-buttons .ghost-button {
  min-width: 132px;
}

.history-filters .preset-select {
  min-width: 220px;
}

.specialist-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.specialist-control-row .filter-field {
  min-width: 200px;
}

.specialist-control-row .specialist-inline-field {
  min-width: 140px;
}

#tab-panel-specialist-history .history-header {
  margin-bottom: var(--space-2);
}

#tab-panel-specialist-history .history-header h3 {
  margin: 0;
}

#tab-panel-specialist-history .history-header .specialist-control-row {
  flex: 0 1 210px;
  justify-content: flex-end;
  margin: 0 0 0 auto;
  min-width: min(100%, 210px);
}

#tab-panel-specialist-history
  .history-header
  .specialist-control-row:has(#specialistSelectField[hidden]) {
  display: none;
}

#tab-panel-specialist-history .history-header .specialist-control {
  width: min(210px, 100%);
}

@media (max-width: 720px) {
  #tab-panel-specialist-history .history-header .specialist-control-row {
    flex-basis: 100%;
    justify-content: stretch;
    margin-left: 0;
  }

  #tab-panel-specialist-history .history-header .specialist-control {
    width: 100%;
  }
}

.specialist-control.is-searchable-picker {
  position: relative;
  min-width: min(360px, 100%);
  width: min(420px, 100%);
}

.specialist-control.is-searchable-picker .specialist-select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 46px;
  opacity: 0;
  pointer-events: none;
}

.specialist-picker {
  position: relative;
  width: 100%;
}

.specialist-picker-trigger {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0 var(--space-4);
  font: inherit;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}

.specialist-picker-trigger:hover,
.specialist-picker-trigger:focus-visible {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.specialist-picker-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.specialist-picker-chevron {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1;
}

.specialist-picker-menu {
  position: absolute;
  z-index: 130;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: min(250px, calc(100vw - 32px));
  max-height: min(420px, 60vh);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.specialist-picker-search-row {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface);
}

.specialist-picker-search {
  width: 100%;
  min-height: 42px;
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-3);
  font: inherit;
  background: var(--color-surface-subtle);
}

.specialist-picker-search:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.specialist-picker-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
}

.specialist-picker-option {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.specialist-picker-option:hover,
.specialist-picker-option:focus-visible,
.specialist-picker-option[aria-selected="true"] {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  outline: none;
}

.specialist-picker-option.is-placeholder {
  color: var(--color-text-muted);
}

.specialist-picker-empty {
  margin: 0;
  padding: var(--space-3);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.history-filters .stretch-field {
  flex: 1 1 auto;
  min-width: 260px;
}

.column-visibility-menu {
  position: absolute;
  right: var(--space-1);
  top: calc(100% + var(--space-2));
  min-width: 220px;
  width: 260px;
  max-width: 320px;
  max-height: 360px;
  padding: var(--space-4);
  border: 1.25px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated, #fff);
  box-shadow: var(--shadow-lg);
  z-index: 4500;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: auto;
}

.column-visibility-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 24px;
  width: 16px;
  height: 16px;
  background: var(--surface-elevated);
  border-left: 1.25px solid var(--gray-200);
  border-top: 1.25px solid var(--gray-200);
  transform: rotate(45deg);
}

.column-menu-title {
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  color: var(--gray-600);
  margin: 0;
}

.column-menu-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.column-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
}

.column-menu-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.column-menu-reset {
  align-self: flex-start;
  font-size: 0.75rem;
  padding: 0;
}

.data-table th.has-column-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-right: var(--space-2);
}

.column-menu-icon {
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 1.35rem;
  cursor: pointer;
  padding: var(--space-1);
  margin-left: auto;
}

.column-menu-icon:hover,
.column-menu-icon:focus {
  color: var(--gray-900);
}

@media (max-width: 720px) {
  .data-table th.has-column-menu .column-visibility-menu {
    left: var(--space-1);
    right: auto;
  }
  .data-table th.has-column-menu .column-visibility-menu::before {
    left: 28px;
    right: auto;
  }
}

.data-table col.is-column-hidden {
  display: none;
}

.data-table th.is-column-hidden,
.data-table td.is-column-hidden {
  display: none;
}

.summary-export-options-dialog {
  width: min(960px, calc(100vw - 48px));
  max-width: 960px;
  max-height: min(90vh, 760px);
}

.summary-export-options-body {
  max-height: min(64vh, 560px);
  overflow: auto;
  padding-right: var(--space-1);
}

.summary-export-intro {
  margin: 0;
}

.summary-export-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
}

.summary-export-section-title {
  margin: 0;
  font-size: 0.95rem;
}

.summary-export-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 8px;
}

.summary-export-range-actions,
.summary-export-column-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.summary-export-options-modal .small-button {
  min-height: 34px;
  height: 34px;
  padding: 0 var(--space-3);
  font-size: 0.82rem;
}

.summary-export-radio {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-weight: var(--font-weight-medium);
}

.summary-export-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.summary-export-hint {
  margin: 0;
}

.summary-export-inline-field {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(130px, 220px);
  align-items: center;
  gap: var(--space-3);
}

.summary-export-inline-field label {
  font-weight: var(--font-weight-medium);
}

.summary-export-inline-field input[type="number"] {
  width: 100%;
}

.summary-export-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.summary-export-date-grid label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 0.86rem;
  font-weight: var(--font-weight-medium);
}

.summary-export-columns-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
  max-height: 240px;
  overflow: auto;
  padding-right: var(--space-1);
}

.summary-export-column-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 0.86rem;
}

.summary-export-column-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  flex-shrink: 0;
}

#summaryExportOptionsError {
  margin: 0;
}

@media (max-width: 900px) {
  .summary-export-options-dialog {
    width: min(100%, calc(100vw - 24px));
  }
}

@media (max-width: 720px) {
  .summary-export-inline-field,
  .summary-export-date-grid {
    grid-template-columns: 1fr;
  }

  .summary-export-columns-list {
    grid-template-columns: 1fr;
  }
}

.app-flash-screen {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  z-index: 999;
  opacity: 0;
  transition: opacity 50ms ease-in-out;
}

.app-flash-screen.is-visible {
  opacity: 1;
}

.app-flash-content {
  text-align: center;
  color: #178d9a;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
}

.loader-bubbles {
  display: flex;
  gap: var(--space-3);
}

.loader-bubble {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #279955;
  opacity: 0.75;
  animation: flash-bounce 0.5s infinite ease-in-out;
}

.loader-bubble:nth-child(2) {
  animation-delay: 0.15s;
}

.loader-bubble:nth-child(3) {
  animation-delay: 0.3s;
}

.loader-bubble:nth-child(4) {
  animation-delay: 0.45s;
}

@keyframes flash-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.25;
  }
  40% {
    transform: translateY(-12px);
    opacity: 1;
  }
}

.app-flash-message {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.snapshot-refresh-button {
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
    line-height: 20px;
  position: relative;
}

.snapshot-refresh-button.is-long-press-arming::after,
.snapshot-refresh-button.is-long-press-ready::after,
.snapshot-refresh-button.is-long-press-active::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  pointer-events: none;
  border: 2px dashed rgba(37, 99, 235, 0.35);
  animation: snapshot-long-press 0.6s linear infinite;
}

.snapshot-refresh-button.is-long-press-ready::after,
.snapshot-refresh-button.is-long-press-active::after {
  border-style: solid;
  border-color: rgba(37, 99, 235, 0.55);
}

@keyframes snapshot-long-press {
  0% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.75;
  }
  100% {
    opacity: 0.3;
  }
}

.snapshot-refresh-button.snapshot-has-pending {
  color: #ffffff;
}

.snapshot-refresh-button.snapshot-pending-1 {
  background: linear-gradient(135deg, #047857, #10b981);
  border-color: #047857;
  box-shadow: 0 0 0 1px rgba(4, 120, 87, 0.3);
}

.snapshot-refresh-button.snapshot-pending-2 {
  background: linear-gradient(135deg, #b45309, #f59e0b);
  border-color: #b45309;
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.35);
}

.snapshot-refresh-button.snapshot-pending-3 {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  border-color: #b91c1c;
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.4);
}

.snapshot-refresh-button.snapshot-status-processing {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.snapshot-refresh-button.snapshot-status-error {
  background: linear-gradient(135deg, #7f1d1d, #b91c1c);
  border-color: #7f1d1d;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.45);
}

.snapshot-refresh-button:disabled {
  opacity: 0.75;
}

.summary-snapshot-info {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  text-align: center;
}

.summary-snapshot-info.is-loading {
  color: var(--color-text-muted);
}

.summary-snapshot-info.is-error {
  color: var(--color-danger, #b91c1c);
}

.summary-snapshot-info.is-empty {
  color: var(--color-warning, #b45309);
}

.summary-snapshot-info.is-realtime {
  color: var(--color-text-muted);
}

.summary-sidebar-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: var(--space-4) 0 var(--space-3);
  width: 100%;
}

.summary-sidebar-controls .summary-period-control {
  justify-content: center;
}

.summary-sidebar-controls .snapshot-refresh-wrapper {
  justify-content: center;
  width: 100%;
}

.settings-hub.is-sidebar-collapsed .summary-sidebar-controls {
  display: none;
}

.summary-calendar-layout {
  display: grid;
  grid-template-columns: 0.38fr 0.62fr;
  gap: var(--space-2);
  align-items: flex-start;
}

.summary-metrics-column {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  background: var(--color-surface-muted);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.summary-metrics-header h4 {
  margin: 0;
}

.summary-stats-wrapper {
  margin: 0;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.summary-stat-card {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 100px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.summary-stat-empty-message {
  font-size: 0.9rem;
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-1) 0;
}

.summary-calendar-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.summary-calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.summary-calendar-period-label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
}

.summary-calendar-mode {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.summary-calendar-mode-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.summary-calendar-mode-button {
  border: 1.25px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.summary-calendar-mode-button.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary-strong, var(--color-primary));
  background: var(--color-primary-soft);
}

.summary-calendar-mode-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.summary-calendar {
  margin: 0 auto;
  width: 100%;
  max-width: 720px;
}

@media (max-width: 1200px) {
  .summary-calendar-layout {
    grid-template-columns: 1fr;
  }

  .summary-metrics-column {
    order: 2;
  }

  .summary-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}


.summary-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.summary-header h2 {
  margin: 0;
}

.summary-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.summary-top-layout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.summary-calendar-column {
  flex: 2 1 420px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.period-control-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.summary-period-control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.summary-period-button {
  min-width: 2rem;
  height: 2rem;
  padding: 0 var(--space-2);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.summary-period-button:hover,
.summary-period-button:focus-visible {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

.summary-period-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.summary-period-display {
  min-width: 8rem;
  padding: 0.35rem var(--space-3);
  border: 1.25px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  background: var(--color-surface-strong);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.summary-period-display:hover,
.summary-period-display:focus-visible {
  border-color: var(--color-border-highlight);
  background: var(--color-surface-hover);
}

.summary-period-display:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.summary-period-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  z-index: 10;
  min-width: 12rem;
}

.summary-period-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  transition: background-color 0.2s ease;
}

.summary-period-option:hover,
.summary-period-option:focus-visible {
  background: var(--color-surface-hover);
}

.summary-period-option.is-active {
  background: var(--color-surface-strong);
  border: 1.25px solid var(--color-border);
}

.summary-calendar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.summary-calendar {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface-subtle);
  min-height: 220px;
  overflow: hidden;
}

.summary-calendar-body {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}

.summary-calendar-day-labels {
  display: grid;
  grid-template-rows: repeat(7, var(--calendar-cell-size));
  gap: 4px;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  padding-top: 1.75rem;
}

.summary-calendar-day-labels span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 28px;
}

.summary-calendar-grid-wrapper {
  overflow-x: auto;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  justify-content: flex-end;
}

.summary-calendar-grid-wrapper::-webkit-scrollbar {
  display: none;
}

.summary-calendar-segments {
  display: flex;
  gap: var(--space-3);
  min-width: max-content;
  justify-content: flex-end;
}

.summary-calendar-segment {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.summary-calendar-segment-title {
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
}

.summary-calendar-grid {
  --calendar-cell-size: 18px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min-content;
  grid-template-rows: repeat(7, var(--calendar-cell-size));
  gap: 4px;
}

.summary-calendar-day {
  width: var(--calendar-cell-size);
  height: var(--calendar-cell-size);
  border-radius: 3px;
  background: var(--color-surface);
  border: 1.25px solid var(--color-border);
  transition: transform 0.1s ease-in-out;
}

.summary-calendar-day.level-0 {
  background: var(--color-surface);
}

.summary-calendar-day.level-1 {
  background: #dbeafe;
  border-color: #bfdbfe;
}

.summary-calendar-day.level-2 {
  background: #bfdbfe;
  border-color: #93c5fd;
}

.summary-calendar-day.level-3 {
  background: #93c5fd;
  border-color: #60a5fa;
}

.summary-calendar-day.level-4 {
  background: #3b82f6;
  border-color: #1d4ed8;
}

.summary-calendar-day.is-outside {
  opacity: 0.3;
}

.summary-calendar-day:hover {
  transform: scale(1.05);
}

.summary-calendar-segment.segment-previous .summary-calendar-day.level-1 {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.summary-calendar-segment.segment-previous .summary-calendar-day.level-2 {
  background: #bbf7d0;
  border-color: #86efac;
}

.summary-calendar-segment.segment-previous .summary-calendar-day.level-3 {
  background: #86efac;
  border-color: #4ade80;
}

.summary-calendar-segment.segment-previous .summary-calendar-day.level-4 {
  background: #22c55e;
  border-color: #15803d;
}

.summary-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.summary-calendar-legend-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.summary-calendar-legend-label {
  font-weight: var(--font-weight-medium);
}

.summary-calendar-legend-scale {
  display: flex;
  gap: 4px;
}

.summary-calendar-legend-scale .summary-calendar-day {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.summary-calendar-legend-group.segment-previous .summary-calendar-day.level-1 {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.summary-calendar-legend-group.segment-previous .summary-calendar-day.level-2 {
  background: #bbf7d0;
  border-color: #86efac;
}

.summary-calendar-legend-group.segment-previous .summary-calendar-day.level-3 {
  background: #86efac;
  border-color: #4ade80;
}

.summary-calendar-legend-group.segment-previous .summary-calendar-day.level-4 {
  background: #22c55e;
  border-color: #15803d;
}

.search-input {
  padding-left: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7'%3E%3C/circle%3E%3Cline x1='16.65' y1='16.65' x2='21' y2='21'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 1rem;
  background-position: 0.85rem center;
  border-radius: var(--radius-xl);

}

.summary-search-inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.summary-search-inline__bar {
  flex: 1 1 560px;
  max-width: 820px;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-1);
  border-radius: var(--radius-xl);
  border: 1.25px solid var(--color-border);
  background: rgba(248, 250, 252, 0.9);
  box-shadow: var(--shadow-sm);
}

.summary-search-inline__bar:focus-within {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.22), var(--shadow-sm);
}

.summary-search-inline input[type="search"] {
  max-width: none;
  width: 100%;
}

.summary-search-inline__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding-right: 8px;
}

.summary-search-inline__field {
  flex: 1 1 0;
  min-width: 0;
}

.summary-search-inline__bar .search-input {
  border: none;
  background-color: transparent;
  padding-right: var(--space-2);
  box-shadow: none;
  outline: none;
  min-height: 44px;
  line-height: 1.25;
}

.summary-search-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  min-height: 1rem;
  padding-left: 32px;
}

.summary-search-inline__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: nowrap;
  margin-left: auto;
  max-width: 45%;
  min-width: 0;
  justify-content: flex-end;
  min-height: 44px;
}

.summary-search-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  justify-content: flex-end;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: thin;
}

.vtiger-review-search {
  display: flex;
  align-items: center;
  border-radius: var(--radius-xl);
  justify-content: space-between;
  gap: var(--space-4);
  max-width: clamp(100px, 40vw, 480px);
  width: 100%;
}

@media (max-width: 768px) {
  .summary-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .summary-header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .summary-top-layout {
    flex-direction: column;
  }
  .summary-calendar-column {
    min-width: unset;
  }
  .summary-search-inline input[type="search"] {
    max-width: 100%;
  }
  .summary-search-inline {
    flex-direction: column;
    align-items: flex-start;
  }
  .summary-search-inline__bar {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }
  .summary-search-inline__row {
    flex-direction: column;
    align-items: stretch;
  }
  .summary-search-inline__field {
    width: 100%;
  }
  .summary-search-inline__meta {
    max-width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .summary-search-chips {
    justify-content: flex-start;
    overflow-x: visible;
  }
}

.summary-stat-card .summary-stat-value {
  font-size: 1.65rem;
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
}

.summary-stat-card .summary-stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.summary-stat-card.muted {
  background: var(--color-surface-subtle);
  color: var(--color-text-muted);
  border-style: dashed;
}

.summary-stat-card.error-card {
  background: var(--color-danger-soft);
  border-color: transparent;
  color: var(--color-danger, #b91c1c);
}

.summary-stat-card--placeholder .summary-stat-value {
  color: var(--color-text-muted);
}

.history-filters {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
}

.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.history-header h3 {
  margin-bottom: var(--space-2);
}

.resubmit-helper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  border: 1.25px dashed var(--color-border);
  background: var(--color-surface-subtle);
}

.resubmit-helper .helper-caption {
  margin: 0;
  font-size: 0.9rem;
}

.hr-accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: var(--space-4);
}

.hr-panel {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.hr-panel.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.hr-panel.is-disabled summary {
  cursor: not-allowed;
}

.hr-panel[data-manage-specialist-panel="list"] {
  overflow: visible;
}

.hr-panel[data-manage-director-panel="list"] {
  overflow: visible;
}

.hr-subsection-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.hr-subsection-header h3 {
  margin: 0;
}

.hr-subsection-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.group-overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.group-overview-card {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.group-overview-card p {
  margin: 0;
}

.group-overview-value {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.group-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.group-search-field {
  flex: 1 1 320px;
}

.group-search-field input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
  font-size: 0.95rem;
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.group-search-field input:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.group-table th,
.group-table td {
  vertical-align: top;
}

.group-table td {
  font-size: 0.95rem;
}

.group-table .table-actions-heading {
  width: 130px;
  text-align: center;
}

.group-description {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.group-modal-meta {
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

.group-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.group-modal-actions .danger-button,
.group-modal-actions .primary-button {
  flex: 0 0 auto;
}

.hr-panel summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  font-weight: var(--font-weight-semibold);
  list-style: none;
}

.hr-panel summary::-webkit-details-marker {
  display: none;
}

.hr-panel summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid currentColor;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
  transition: transform var(--transition-base);
}

.two-column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.priority-ranking-section > h3 {
  margin-bottom: var(--space-4);
}

.priority-ranking-section h5 {
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
}

.priority-ranking-section .priority-ranking-group-title {
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
}

.priority-ranking-section .table-container {
  margin-top: var(--space-2);
}

.priority-ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: var(--space-5);
}

.priority-ranking-table th,
.priority-ranking-table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1.25px solid var(--color-border);
}

.priority-ranking-table tbody tr.priority-row-muted {
  opacity: 0.6;
}

.priority-ranking-table tbody tr.priority-row-top td:first-child {
  font-weight: var(--font-weight-semibold);
}

.priority-status-ready {
  color: var(--color-success, #166534);
}

.priority-status-capacity {
  color: var(--color-warning, #b45309);
}

.priority-status-unavailable {
  color: var(--color-danger, #b91c1c);
}

.priority-reservation-max {
  color: var(--color-danger, #b91c1c);
  font-weight: var(--font-weight-semibold);
}

.priority-metrics-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.priority-metric-card {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface-muted);
  text-align: center;
}

.priority-metric-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.priority-metric-value {
  font-size: 1.6rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-strong);
  display: block;
}

.priority-metric-caption {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: var(--space-1) 0 0;
}

.priority-group-toggle-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.priority-group-toggle {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.priority-group-toggle.is-inactive {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  border-color: transparent;
  opacity: 0.6;
}

.priority-component-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.priority-component-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--color-surface);
}

.priority-component-group.is-hidden {
  display: none;
}

.priority-component-group-label {
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.priority-component-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.priority-component-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.priority-component-row-label {
  flex: 0 0 170px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.priority-component-bar-track {
  flex: 1;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-surface-muted);
  border: 1.25px solid var(--color-border);
  overflow: hidden;
  position: relative;
}

.priority-component-bar {
  display: flex;
  height: 100%;
  transition: width var(--transition-fast);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.priority-component-segment {
  height: 100%;
  position: relative;
}

.priority-component-bar:first-child .priority-component-segment:first-child,
.priority-component-segment:first-child {
  border-top-left-radius: var(--radius-full);
  border-bottom-left-radius: var(--radius-full);
}

.priority-component-bar:last-child .priority-component-segment:last-child,
.priority-component-segment:last-child {
  border-top-right-radius: var(--radius-full);
  border-bottom-right-radius: var(--radius-full);
}

.priority-component-segment + .priority-component-segment::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -0.5px;
  width: 1px;
  background: var(--color-surface);
  pointer-events: none;
}

.priority-component-segment.load {
  background: #0f9d58;
}

.priority-component-segment.sla {
  background: #f4b400;
}

.priority-component-segment.skill {
  background: #db4437;
}

.priority-component-segment.reservation {
  background: #7c3aed;
}

.priority-component-segment.penalty {
  background: #ef4444;
  opacity: 0.85;
}

.priority-component-row-value {
  flex: 0 0 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-strong);
}

.priority-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--color-surface-subtle);
  border: 1.25px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  cursor: default;
  position: relative;
}

.priority-component-chart::-webkit-scrollbar {
  height: 6px;
}

.priority-component-chart::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.priority-component-legend {
  display: flex;
  gap: var(--space-3);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  justify-content: center;
}

.priority-component-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.priority-component-legend .legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-xs);
  display: inline-block;
}

.legend-swatch.load {
  background: #0f9d58;
}

.legend-swatch.sla {
  background: #f4b400;
}

.legend-swatch.skill {
  background: #db4437;
}

.legend-swatch.reservation {
  background: #7c3aed;
}

.priority-status-leaved {
  color: #475569;
}

.hr-panel[open] summary::after {
  transform: rotate(225deg);
}

.hr-panel[open] summary {
  background: var(--color-surface-subtle);
  color: var(--color-primary);
}

.factory-reset-panel summary {
  color: var(--color-danger, #b91c1c);
}

.factory-reset-panel[data-state="running"] {
  border-color: var(--color-warning, #b45309);
}

.factory-reset-panel[data-state="error"] {
  border-color: var(--color-danger, #b91c1c);
}

.factory-reset-panel[data-state="done"] {
  border-color: var(--color-success, #166534);
}

.factory-reset-callout {
  border: 1.25px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: rgba(254, 242, 242, 0.85);
  color: #7f1d1d;
  font-size: 0.95rem;
  line-height: 1.5;
}

.factory-reset-callout ul {
  margin: var(--space-3) 0 0 1.25rem;
  padding: 0;
}

.factory-reset-form {
  margin-bottom: var(--space-1);
}

.factory-reset-actions {
  display: flex;
  justify-content: flex-start;
}

.factory-reset-actions .danger-button {
  min-width: 220px;
}

.hr-panel-body {
  padding: var(--space-2);
  border-top: 1.25px solid var(--color-border);
  display: grid;
  gap: var(--space-4);
}

.hr-panel .action-buttons {
  justify-content: flex-start;
  gap: var(--space-3);
}

.hr-panel .action-buttons.action-buttons-spaced {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: var(--space-4);
  width: 100%;
}

.hr-panel .action-buttons.action-buttons-spaced > button {
  min-width: 0;
}

.specialist-list-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.specialist-list-toolbar input[type="search"] {
  min-width: 240px;
  width: clamp(240px, 100vw, 800px);
}

.specialist-list-toolbar .settings-toolbar-actions {
  position: relative;
  overflow: visible;
}

.specialist-list-toolbar .settings-toolbar-actions button {
  white-space: nowrap;
}

.director-toolbar {
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.director-toolbar .settings-toolbar-actions {
  align-items: flex-end;
}

.director-table th[data-director-actions],
.director-table .director-actions-col {
  width: 110px;
  text-align: center;
}

.director-table .table-actions {
  justify-content: center;
}

.director-table tr.is-paused {
  background: rgba(248, 113, 113, 0.05);
}

.director-context {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
  padding: var(--space-4);
  border: 1.25px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated, #fff);
}

.director-context-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  flex: 1 1 auto;
}

.director-context-grid > div {
  min-width: 180px;
}

.director-context-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
}

.director-context-actions .ghost-button {
  white-space: nowrap;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.badge-list span {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-3);
  height: 28px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-size: 0.85rem;
  color: var(--color-heading);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 0 var(--space-1);
  height: 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1.25px solid rgba(16, 185, 129, 0.4);
  color: #059669;
}

.status-badge.status-badge--paused {
  background: #fef2f2;
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.15);
}

.status-chip {
  --status-dot-color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  margin-top: 0;
  color: var(--color-text, #0f172a);
  background: transparent;
  white-space: nowrap;
}

.status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--status-dot-color);
}

.status-chip.status-chip--ready {
  --status-dot-color: #16a34a;
}

.status-chip.status-chip--warning {
  --status-dot-color: #d97706;
}

.status-chip.status-chip--danger {
  --status-dot-color: #dc2626;
}

.status-chip.status-chip--draft {
  --status-dot-color: #2563eb;
}

.status-chip.status-chip--paused {
  --status-dot-color: #b91c1c;
}

.status-chip.status-chip--away {
  --status-dot-color: #c2410c;
}

.status-chip.status-chip--leaved {
  --status-dot-color: #475569;
}

.person-name-with-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.status-dot.status-dot--active {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.status-dot.status-dot--paused {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-dot.status-dot--away {
  background: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.status-dot.status-dot--leaved {
  background: #9ca3af;
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2);
}
.eyebrow-text {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  margin: 0 0 var(--space-2);
  display: inline-block;
}

.leave-alert-panel {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--space-2);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised, #fff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.leave-alert-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
}

.leave-alert-header h4 {
  margin: 0;
}

.leave-alert-header-actions {
  display: flex;
  gap: var(--space-2);
}

.leave-alert-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
}

.leave-alert-item {
  border-top: 1.25px solid var(--color-border-subtle, rgba(15, 23, 42, 0.08));
  padding: var(--space-3) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.leave-alert-item:first-child {
  border-top: none;
  padding-top: 0;
}

.leave-alert-item-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: flex-start;
}

.leave-alert-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-strong);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.leave-alert-meta {
  color: var(--color-text-subtle);
  font-size: 0.9rem;
}

.leave-alert-stats {
  font-size: 0.9rem;
  color: var(--color-text);
  margin-top: var(--space-1);
}

.leave-alert-actions {
  display: flex;
  border-radius: var(--radius-xl);
  gap: var(--space-2);
  flex-wrap: wrap;
}

.leave-alert-actions .primary-button,
.leave-alert-actions .secondary-button {
  min-height: 36px;
}

.leave-alert-manual-btn {
  justify-self: stretch;
  padding-top: 5px;
  padding-bottom: 5px;
}

.leave-alert-card {
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface, #fff);
  min-width: 260px;
}

.leave-alert-card-title {
  margin: 0 0 var(--space-2) 0;
  padding-bottom: 10px;
  font-weight: 600;
}

.leave-alert-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-2);
}

.leave-alert-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.leave-alert-sample-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leave-alert-sample-table th,
.leave-alert-sample-table td {
  padding: var(--space-2) var(--space-1);
  border-bottom: 1.25px solid rgba(148, 163, 184, 0.3);
  text-align: left;
}

.leave-alert-sample-table tr:last-child td {
  border-bottom: none;
}

.leave-alert-empty-note {
  font-style: italic;
  color: var(--color-text-subtle);
}

.leave-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  height: 22px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
}

.leave-alert-item[data-status="ongoing"] .leave-alert-badge {
  color: #b91c1c;
}

.leave-alert-list .small-text {
  margin: 0;
}


.director-handoff-actions {
  justify-content: flex-end;
  gap: var(--space-2);
}

.leave-alert-inline-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.leave-alert-inline-inputs > * {
  flex: 1 1 240px;
}

.leave-alert-error {
  color: var(--color-danger);
  margin: var(--space-2) 0;
}

.leave-alert-sample-table th {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.leave-alert-actions .secondary-button.is-loading,
.leave-alert-actions .primary-button.is-loading {
  pointer-events: none;
}

.user-status-leaved {
  color: #64748b;
}

.user-status-leaved-row td {
  color: #64748b;
}

.icon-button.is-disabled,
.danger-icon-button.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.director-toggle-field {
  margin-bottom: var(--space-4);
}

.director-config-block {
  margin-top: var(--space-4);
  border-top: 1.25px dashed rgba(15, 23, 42, 0.08);
  padding-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.director-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.director-config-grid label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-weight: var(--font-weight-medium);
}

.weight-grid {
  gap: var(--space-3);
}

.weight-control {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.weight-control-label {
  font-weight: var(--font-weight-medium);
}

.weight-control-inputs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.weight-control-inputs input[type="number"] {
  width: 96px;
}

.weight-control-inputs input[type="range"] {
  flex: 1;
}

.weight-actions {
  margin-top: var(--space-3);
  display: flex;
  justify-content: flex-end;
}

.director-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.modal-section {
  border: 1.25px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.modal-section h4 {
  margin: 0;
  font-size: 1rem;
}

.director-schedule-card {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.director-schedule-header h4 {
  margin: 0;
}

.director-schedule-toolbar {
  gap: var(--space-3);
}

.director-modal-actions {
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.98),
    rgba(255, 255, 255, 0.92),
    rgba(255, 255, 255, 0.88),
    transparent
  );
  gap: var(--space-3);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: var(--radius-full, 999px);
  position: relative;
  overflow: visible;
}

.icon-button svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.icon-button img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.icon-button--ghost {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.icon-button--ghost:hover,
.icon-button--ghost:focus-visible {
  background: transparent;
  box-shadow: none;
}

.danger-icon-button {
  color: rgba(148, 163, 184, 0.8);
  border-color: rgba(148, 163, 184, 0.3);
  background: transparent;
  transition: color var(--transition-base), border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
  position: relative;
}

.danger-icon-button svg {
  width: 18px;
  height: 18px;
}

.danger-icon-button:hover,
.danger-icon-button:focus-visible {
  color: var(--color-danger);
  border-color: rgba(220, 38, 38, 0.5);
  background: rgba(220, 38, 38, 0.08);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.danger-icon-button:active {
  background: rgba(220, 38, 38, 0.16);
}

.danger-icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 10;
}

.danger-icon-button:hover::after,
.danger-icon-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, -4px);
}

.icon-button[data-tooltip]:hover::after,
.icon-button[data-tooltip]:focus-visible::after,
.ghost-icon-button[data-tooltip]:hover::after,
.ghost-icon-button[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: var(--color-heading);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  border: 1.25px solid var(--color-border);
  z-index: 10;
  pointer-events: none;
  max-width: 420px;
  min-width: 0;
  width: max-content;
  white-space: normal;
  text-align: left;
  display: block;
}

.icon-button[data-tooltip]:hover::before,
.icon-button[data-tooltip]:focus-visible::before,
.ghost-icon-button[data-tooltip]:hover::before,
.ghost-icon-button[data-tooltip]:focus-visible::before {
  content: "";
  position: absolute;
  bottom: calc(100% + var(--space-1));
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
  z-index: 10;
  pointer-events: none;
}

.transfer-candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-start;
  align-items: stretch;
  max-height: 280px;
  overflow-y: auto;
  padding: var(--space-3);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.transfer-candidate-label {
  display: block;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-2);
}

.transfer-candidate-list[data-state="disabled"] {
  opacity: 0.65;
  pointer-events: none;
}

.transfer-candidate-option {
  display: flex;
  position: relative;
  flex: 0 1 280px;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface-subtle);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-base), box-shadow var(--transition-base),
    border-color var(--transition-base), transform var(--transition-base);
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
}

.transfer-candidate-option:hover {
  background: var(--color-neutral-soft);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.transfer-candidate-option:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.transfer-candidate-option .indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  font-size: 0.8rem;
  transition: border-color var(--transition-base), background var(--transition-base),
    color var(--transition-base);
  flex-shrink: 0;
}

.transfer-candidate-option .text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.transfer-candidate-option .meta {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.transfer-candidate-option.is-selected {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.transfer-candidate-option.is-selected .indicator {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.transfer-actions button:not(.transfer-menu-toggle) {
  min-width: 140px;
}

.transfer-actions .secondary-button {
  min-width: 140px;
}

.transfer-actions .withdraw-transfer-button {
  flex: 0 0 auto;
  padding: 0;
}

.modal .action-buttons .withdraw-transfer-button {
  flex: 0 0 auto;
}

.review-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.review-primary-actions {
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: var(--space-3);
}

.review-primary-actions button {
  flex: 0 0 auto;
  min-width: 140px;
}

.score-selector {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-left: auto;
  align-items: flex-end;
  text-align: right;
  min-width: 180px;
}

.score-selector-label {
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.score-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.score-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  color: inherit;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: border-color var(--transition-base), background var(--transition-base),
    color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.score-option .score-option-value {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-subtle);
  border: 2px solid var(--color-border);
  font-weight: var(--font-weight-semibold);
  transition: border-color var(--transition-base), background var(--transition-base),
    color var(--transition-base);
}

.score-option .score-option-label {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--transition-fast), max-width var(--transition-base);
  color: var(--color-text-muted);
}

.score-option.is-selected .score-option-label,
.score-option[aria-pressed="true"] .score-option-label {
  opacity: 1;
  max-width: 12rem;
}

.score-option:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.score-option:hover .score-option-value {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.score-option.is-selected {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.score-option.is-selected .score-option-value {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.transfer-candidate-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  width: 100%;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.submit-action-field {
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
}

@media (max-width: 640px) {
  #tab-panel-specialist-history .history-filters {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2);
  }

  #tab-panel-specialist-history .history-filters .stretch-field {
    min-width: 0;
  }

  #tab-panel-specialist-history .submit-action-field {
    min-width: 0;
  }

  #openSubmitModalButton.icon-expand-button {
    width: 50px;
    min-width: 50px;
    padding: 0;
    flex: 0 0 50px;
  }

  #openSubmitModalButton.icon-expand-button .icon-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }
}

.table-container {
  overflow-x: auto;
  overflow-y: clip;
  border-radius: var(--radius-md);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.import-session-board-table {
  overflow: visible;
}

.table-container.scrollable {
  overflow-x: auto;
  overflow-y: auto;
  max-height: none;
}

.history-table-container {
  max-height: none !important;
  overflow-y: clip !important;
}

.history-table-container.scrollable {
  max-height: none !important;
  overflow-y: clip !important;
}

.history-table-container table {
  width: max(100%, 960px);
  min-width: 960px;
  overflow: visible !important;
}

.history-table-container tbody {
  display: table-row-group;
  overflow: visible !important;
}

.table-container.scrollable .resizable-table {
  min-width: 100%;
}

.table-container.scrollable .resizable-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-surface-subtle);
  box-shadow: inset 0 -1px 0 var(--color-border);
}

.resizable-table {
  width: 100%;
  border-collapse: collapse;
}

.resizable-table th,
.resizable-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: middle;
  color: inherit;
  word-break: break-word;
  white-space: normal;
}

.resizable-table th {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.resizable-table th .column-header-label {
  display: block;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resizable-table th.is-sortable .column-header-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.resizable-table th[data-sort-mode-label] .column-header-label::before {
  content: attr(data-sort-mode-label);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface);
}

.resizable-table th.is-sortable .column-header-label::after {
  content: "↕";
  font-size: 0.75rem;
  opacity: 0.35;
}

.resizable-table th[data-sort-direction="asc"] .column-header-label::after {
  content: "↑";
  opacity: 0.8;
}

.resizable-table th[data-sort-direction="desc"] .column-header-label::after {
  content: "↓";
  opacity: 0.8;
}

.resizable-table tbody tr:nth-child(odd) {
  background: rgba(148, 163, 184, 0.05);
}

.resizable-table tfoot .summary-row {
  background: var(--color-surface-subtle);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.resizable-table tfoot .summary-row td {
  text-align: left;
  border-top: 2px solid var(--color-border);
  border-bottom: none;
}

.resizable-table tfoot .summary-row strong {
  color: var(--color-heading);
}

.group-table .group-summary-row td {
  background: var(--color-surface-subtle);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  border-top: 2px solid var(--color-border);
}

.group-table .group-summary-row strong {
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
}

.history-row,
.assignment-row {
  position: relative;
  cursor: pointer;
  transition: background var(--transition-base);
}

.history-row:hover,
.history-row:focus-visible,
.assignment-row:hover,
.assignment-row:focus-visible {
  background: var(--color-primary-soft);
}

.history-row.is-context-active,
.assignment-row.is-context-active {
  background: var(--color-primary-soft);
}

.history-row--manual-request td {
  background: #fffdf5;
}

.history-row--manual-request td:first-child {
  box-shadow: inset 3px 0 0 #d97706;
}

.history-manual-request-detail {
  display: grid;
  gap: var(--space-3);
}

.history-manual-request-detail__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.history-manual-request-detail__header h4 {
  margin: 0;
}

.history-manual-request-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.history-manual-request-detail__field {
  display: grid;
  gap: 3px;
}

.history-manual-request-detail__field span {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.history-manual-request-detail__field strong {
  color: var(--color-heading);
}

.history-detail-row td {
  background: var(--color-neutral-soft);
  text-align: left;
  padding: var(--space-4);
  border-bottom: none;
}

.history-detail-content {
  display: grid;
  gap: var(--space-4);
}

.attachments-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.attachments-panel--compact {
  padding: var(--space-2);
  box-shadow: none;
}

.attachments-panel--error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #b91c1c;
}

.attachments-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.attachments-panel-header h4 {
  margin: 0;
  font-size: 1rem;
}

.attachments-panel-actions {
  display: flex;
  gap: var(--space-2);
}

.attachments-modal-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, 520px);
  margin-left: auto;
  order: 2;
}

.attachments-modal-header-actions[hidden] {
  display: none;
}

.attachments-modal-header-actions .attachments-panel-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.attachments-modal-header-actions .ghost-button {
  white-space: nowrap;
}

.attachments-modal-window-actions {
  flex: 0 0 auto;
  order: 3;
}

#attachmentsModal .attachments-modal-header-actions:not([hidden]) + .attachments-modal-window-actions {
  margin-left: 0;
}

.attachments-inline-host {
  margin-top: var(--space-2);
}

.attachments-inline-host .attachments-table-container {
  max-height: 480px;
  overflow-y: auto;
}

.attachments-panel-note,
.attachments-panel-window {
  margin: var(--space-2) 0 0;
}

.attachments-upload {
  margin-top: var(--space-3);
  position: relative;
}

.attachments-upload-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.attachments-upload-header-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.attachments-upload-meta {
  margin: 0;
}

.attachments-upload-activity {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.06), rgba(255, 255, 255, 0.96)),
    var(--color-surface);
}

.attachments-upload-activity[hidden] {
  display: none;
}

.attachments-upload-activity-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.attachments-upload-activity-title {
  color: var(--color-heading);
  font-size: 0.92rem;
}

.attachments-upload-activity-detail {
  min-width: 0;
  flex: 1 1 260px;
}

.attachments-upload-activity-bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
}

.attachments-upload-activity-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
  transition: width 180ms ease;
}

.attachments-upload-activity-fill.is-indeterminate {
  animation: attachments-upload-activity-sweep 1.15s ease-in-out infinite;
}

@keyframes attachments-upload-activity-sweep {
  0% {
    transform: translateX(-88%);
  }
  50% {
    transform: translateX(54%);
  }
  100% {
    transform: translateX(188%);
  }
}

.attachments-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
}

.attachments-upload-row .form-field {
  min-width: 180px;
  flex: 1;
}

.attachments-upload-trigger {
  padding-inline: var(--space-4);
}

.attachments-upload-popover {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  width: min(420px, 92vw);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
}

.attachments-upload-popover.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.attachments-upload-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.attachments-upload-popover-title {
  font-weight: var(--font-weight-semibold);
}

.attachments-upload-popover-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}

.attachments-upload-context {
  margin: 0;
}

.attachments-upload-dropzone {
  min-height: 140px;
}

.attachments-upload-dropzone .import-dropzone-content {
  width: 100%;
}

.attachments-upload-dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  min-width: 0;
}

.attachments-upload-dropzone-copy strong {
  font-size: 0.95rem;
  color: var(--color-heading);
}

.import-dropzone-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-2);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.import-dropzone-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.attachments-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: var(--space-2);
  color: inherit;
  flex-shrink: 0;
}

.attachments-button-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.attachments-upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-left: auto;
}

.attachments-upload-actions .ghost-button,
.attachments-upload-actions .primary-button {
  white-space: nowrap;
}

.attachments-upload-file {
  margin: 0;
}

.attachments-upload-empty-state {
  min-height: 156px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
}

.attachments-upload-empty-state strong {
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
}

.attachments-upload-empty-state p {
  margin: 0;
  max-width: 480px;
}

.attachments-table-container {
  margin-top: var(--space-3);
}

.attachments-row-staging-section td {
  padding: 10px 12px 8px;
  background: transparent;
  border-bottom: none;
}

.attachments-row-staging-section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-heading);
}

.attachments-row-staging-section-meta {
  color: var(--color-text-muted);
  font-weight: 600;
}

.attachments-row-staging {
  background: rgba(15, 23, 42, 0.015);
}

.attachments-row-staging.is-uploading {
  background: rgba(59, 130, 246, 0.05);
}

.attachments-row-staging.is-failed {
  background: rgba(239, 68, 68, 0.05);
}

.attachments-staging-status-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.attachments-staging-status-cell > .status-chip,
.attachments-staging-status-cell > .attachments-upload-status-stack {
  min-width: 0;
  flex: 1 1 auto;
}

.attachments-staging-remove {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.attachments-staging-status-cell.has-detail {
  align-items: flex-start;
}

.attachments-staging-remove:hover,
.attachments-staging-remove:focus-visible {
  color: var(--color-danger);
}

.attachments-staging-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.attachments-upload-table tbody tr.is-uploading {
  background: rgba(59, 130, 246, 0.05);
}

.attachments-upload-table tbody tr.is-failed {
  background: rgba(239, 68, 68, 0.05);
}

.attachments-list-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}

.attachments-list-layout .attachments-table-container {
  flex: 1 1 auto;
  min-width: 0;
}

.attachments-side-rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: auto;
  min-width: 0;
  max-width: none;
}

.attachments-side-rail .attachments-note-panel {
  width: auto;
  min-width: 0;
  max-width: none;
}

.attachments-note-panel {
  width: 260px;
  min-width: 220px;
  max-width: 280px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.attachments-note-panel-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--space-1);
}

.attachments-note-panel-list {
  display: grid;
  gap: var(--space-2);
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.attachments-note-panel-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface);
  display: grid;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.attachments-note-panel-item:hover,
.attachments-note-panel-item:focus-visible {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.attachments-note-panel-item-title {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.attachments-note-panel-item-meta {
  font-size: 0.75rem;
}

.attachments-note-panel-item-body {
  font-size: 0.8rem;
  color: var(--color-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.attachments-note-panel-item-quote-preview {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.62);
}

.attachments-note-panel-item-quote-preview > span {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.attachments-note-panel-item-quote-preview p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.76rem;
  line-height: 1.45;
}

.attachments-note-panel-item-quote-preview mark {
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(250, 204, 21, 0.38);
  color: inherit;
  font-weight: 800;
}

.attachments-table th,
.attachments-table td {
  font-size: 0.85rem;
}

.attachments-graph-head,
.attachments-graph-cell {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}


.attachments-graph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 44px;
}

.attachments-graph-head-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.attachments-graph-head-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.attachments-graph::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
}

.attachments-graph.is-first::before {
  top: 50%;
}

.attachments-graph.is-last::before {
  bottom: 50%;
}

.attachments-graph.is-single::before {
  display: none;
}

.attachments-graph-node {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #64748b;
  border: 2px solid #f8fafc;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.attachments-row-document .attachments-graph-node {
  width: 18px;
  height: 18px;
}

.attachments-row-level1 .attachments-graph-node {
  width: 15px;
  height: 15px;
}

.attachments-graph-node.is-muted {
  opacity: 0.55;
  cursor: default;
}

.attachments-graph-node.is-latest {
  background: #2563eb;
}

.attachments-graph-node.is-draft {
  background: #0ea5e9;
}

.attachments-graph-node.is-late {
  background: #f97316;
}

.attachments-graph-node.is-failed {
  background: #ef4444;
}

.attachments-row-document {
  background: rgba(15, 23, 42, 0.02);
  cursor: pointer;
}

.attachments-row.is-runtime-busy,
.attachments-row-document.is-runtime-busy {
  background: rgba(59, 130, 246, 0.05);
}

.attachments-row-document:hover {
  background: rgba(59, 130, 246, 0.08);
}

.attachments-row.is-runtime-busy:hover,
.attachments-row-document.is-runtime-busy:hover {
  background: rgba(59, 130, 246, 0.1);
}

.attachments-row.is-collapsed {
  display: none;
}

.attachments-group-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.attachments-row-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.attachments-row-toggle::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid #64748b;
  transition: transform var(--transition-base);
}

.attachments-row-toggle.is-expanded::before {
  transform: rotate(90deg);
}

.attachments-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.attachments-file-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.attachments-preview-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 64px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  color: #334155;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.attachments-preview-thumb.is-icon-only {
  width: 24px;
  height: 32px;
  border-radius: 4px;
}

.attachments-preview-thumb[data-file-kind="pdf"] {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  color: #be123c;
}

.attachments-preview-thumb[data-file-kind="docx"] {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}

.attachments-preview-thumb[data-file-kind="xlsx"] {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #047857;
}

.attachments-preview-thumb[data-file-kind="image"] {
  background: linear-gradient(135deg, #fdf4ff, #fae8ff);
  color: #a21caf;
}

.attachments-preview-thumb::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.7);
  border-right: 1px solid rgba(148, 163, 184, 0.7);
  background: #fff;
  transform: rotate(45deg);
}

.attachments-preview-thumb.is-icon-only::after {
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
}

.attachments-preview-thumb-fallback {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 8px 4px 6px;
  text-transform: uppercase;
}

.attachments-preview-thumb.is-icon-only .attachments-preview-thumb-fallback {
  gap: 0;
  padding: 5px 2px 4px;
}

.attachments-preview-thumb-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attachments-preview-thumb.is-icon-only .attachments-preview-thumb-icon {
  width: 11px;
  height: 11px;
}

.attachments-preview-thumb-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachments-preview-thumb-label {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.attachments-preview-thumb.is-icon-only .attachments-preview-thumb-label {
  display: none;
}

.attachments-preview-thumb-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.attachments-preview-thumb.is-loaded {
  color: transparent;
}

.attachments-preview-thumb.is-loaded .attachments-preview-thumb-fallback {
  opacity: 0;
}

.attachments-preview-thumb.is-loaded .attachments-preview-thumb-image {
  opacity: 1;
}

.attachments-preview-thumb.is-error {
  color: #64748b;
}

.attachments-thumb-popover {
  position: fixed;
  z-index: 10005;
  width: 320px;
  height: 440px;
  padding: 8px;
  border-radius: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.12s ease, transform 0.12s ease;
  pointer-events: none;
}

.attachments-thumb-popover.is-visible {
  opacity: 1;
  transform: scale(1);
}

.attachments-thumb-popover-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.attachments-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-row-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-runtime-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  display: inline-flex;
  border-radius: 999px;
  border: 1.8px solid #2563eb;
  border-right-color: transparent;
  animation: button-spin 0.7s linear infinite;
  opacity: 0.9;
}

.attachments-runtime-dot.is-preview {
  border-color: #0369a1;
  border-right-color: transparent;
}

.attachments-runtime-status-chip {
  margin-top: 0;
  white-space: nowrap;
}

.attachments-runtime-status-chip.is-preview {
  --status-dot-color: #0369a1;
}

.attachments-version-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(255, 255, 255, 0.82);
  color: var(--color-text, #0f172a);
}

.attachments-version-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #2563eb;
}

.attachments-late-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.16);
  color: #c2410c;
}

.attachments-child-cell--level1 {
  padding-left: 64px;
}

.attachments-row-level1 td:nth-child(2) {
  padding-left: 64px;
}

.attachments-row-level1 .attachments-file-stack {
  margin-left: 6px;
}

.attachments-table tbody tr.is-context-active {
  background: rgba(59, 130, 246, 0.08);
}

.attachments-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.attachments-empty {
  margin-top: var(--space-2);
}

.attachments-context-menu {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  flex-direction: column;
  min-width: 220px;
  max-width: min(320px, 90vw);
  padding: 6px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
  z-index: 4500;
}

.attachments-context-menu.is-open {
  display: flex;
}

.attachments-context-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px 8px;
}

.attachments-context-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.attachments-context-line {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-context-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 10px;
}

.attachments-context-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
}

.attachments-context-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachments-color-option {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: var(--swatch-color, #facc15);
  cursor: pointer;
}

.attachments-color-option.is-active {
  outline: 2px solid rgba(59, 130, 246, 0.7);
  outline-offset: 1px;
}

.attachments-context-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachments-pdf-note-editor {
  min-width: min(340px, calc(100vw - 24px));
  max-width: min(420px, calc(100vw - 24px));
  padding: 0;
  border-radius: var(--radius-lg);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.attachments-note-editor-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 12px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.92));
}

.attachments-note-editor-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attachments-note-editor-subtitle {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}

.attachments-note-editor-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(226, 232, 240, 0.5);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #334155;
}

.attachments-note-editor-snippet {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.82));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.attachments-note-editor-snippet-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.attachments-note-editor-snippet-text {
  font-size: 0.86rem;
  line-height: 1.5;
  color: #0f172a;
  white-space: normal;
}

.attachments-note-editor-snippet-text mark {
  padding: 0 0.18em;
  border-radius: 0.28em;
  background: rgba(250, 204, 21, 0.34);
  color: inherit;
  box-shadow: inset 0 -1px 0 rgba(217, 119, 6, 0.18);
}

.attachments-pdf-note-editor[data-mode="ask"] .attachments-note-editor-target {
  background: rgba(219, 234, 254, 0.8);
  border-color: rgba(96, 165, 250, 0.35);
  color: #1d4ed8;
}

.attachments-pdf-note-editor[data-target="docx"] .attachments-note-editor-target {
  background: rgba(254, 249, 195, 0.72);
  border-color: rgba(245, 158, 11, 0.28);
  color: #92400e;
}

.attachments-note-input {
  display: block;
  width: 98%;
  box-sizing: border-box;
  min-height: 132px;
  max-height: min(280px, 40vh);
  resize: none;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  margin: 4px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #0f172a;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
}

.attachments-note-input:focus {
  outline: 2px solid rgba(59, 130, 246, 0.42);
  outline-offset: 0;
  border-color: rgba(96, 165, 250, 0.55);
}

.attachments-note-input::placeholder {
  color: #94a3b8;
}

.attachments-note-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
}

.attachments-note-editor-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.attachments-note-editor-shortcut,
.attachments-note-editor-count {
  font-size: 0.76rem;
  color: #64748b;
}

.attachments-note-editor-count {
  font-variant-numeric: tabular-nums;
}

.attachments-note-editor-count.is-near-limit {
  color: #b45309;
}

.attachments-note-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  flex-shrink: 0;
}

.attachments-note-actions .primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .attachments-pdf-note-editor {
    min-width: min(320px, calc(100vw - 20px));
    max-width: min(360px, calc(100vw - 20px));
    border-radius: 18px;
  }

  .attachments-note-editor-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .attachments-note-editor-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .attachments-note-actions {
    justify-content: stretch;
  }

  .attachments-note-actions > button {
    flex: 1 1 0;
  }
}

.attachments-opacity-option {
  width: 36px;
  height: 18px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #f8fafc;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
}

.attachments-opacity-option.is-active {
  border-color: rgba(59, 130, 246, 0.7);
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.attachments-context-line.is-muted {
  font-weight: 500;
  color: #64748b;
}

.attachments-context-divider {
  height: 0.5px;
  background: rgba(148, 163, 184, 0.35);
  margin: 4px 6px;
}

.attachments-context-item {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}

.attachments-context-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

.attachments-context-item.is-danger {
  color: #b91c1c;
}

.attachments-context-item.is-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.attachments-context-item.is-disabled,
.attachments-context-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.attachments-preview-dialog,
.attachments-diff-dialog {
  width: min(1100px, 92vw);
  overflow: visible;
}

.modal-dialog.attachments-preview-dialog--compact {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(71, 85, 105, 0.5);
  padding: 0;
  gap: 0;
  overflow: hidden;
  max-height: 100vh;
}

.modal-dialog.attachments-preview-dialog--fullscreen {
  position: fixed !important;
  left: 24px !important;
  right: 24px !important;
  top: 0 !important;
  bottom: 24px !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  margin: 0 !important;
}

.modal-dialog.attachments-preview-dialog--compact .modal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--space-3);
  padding-bottom: 4px;
  background: rgba(248, 250, 252, 0.25);
  -webkit-backdrop-filter: blur(6px);
  z-index: 6;
}

.modal-dialog.attachments-preview-dialog--compact .modal-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -16px;
  height: 16px;
  background: linear-gradient(
    to bottom,
    rgba(248, 250, 252, 0.25),
    rgba(248, 250, 252, 0)
  );
  pointer-events: none;
}

.modal-dialog.attachments-preview-dialog--compact .modal-body {
  position: relative;
  z-index: 1;
  padding: var(--space-1);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.attachments-preview-modal .modal-dialog.attachments-preview-dialog--compact .modal-header {
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 10px;
  padding-bottom: 6px;
  border-radius: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(246, 247, 249, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.68) inset, 0 10px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.attachments-preview-modal .modal-dialog.attachments-preview-dialog--compact .modal-header::after {
  display: none;
}

.attachments-preview-modal .modal-dialog.attachments-preview-dialog--compact .modal-body {
  padding-top: var(--attachments-header-offset, 54px);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  background: #f8fafc;
}

.attachments-preview-modal .modal-header .modal-title-block {
  order: 1;
  flex: 1 1 220px;
  max-width: min(360px, 32vw);
}

.attachments-preview-modal .modal-header .modal-title-block h3 {
  margin: 0;
  color: #3f3f46;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.18;
}

.attachments-preview-modal .modal-header .modal-title-block .attachments-preview-meta {
  color: #71717a;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.16;
}

.attachments-preview-header-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex: 2 1 auto;
  min-width: 0;
  margin-left: 0;
  order: 2;
  position: relative;
}

.attachments-preview-modal .modal-header .attachments-preview-header-side {
  order: 2;
}

.attachments-preview-format {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.attachments-preview-format-toggle {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: inherit;
  position: relative;
  overflow: visible;
}

.attachments-preview-format-toggle.is-docx {
  color: inherit;
  background: transparent;
}

.attachments-preview-format-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

.attachments-preview-format-toggle[data-tooltip]:hover::after,
.attachments-preview-format-toggle[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  transform: translateX(0);
  background: #fff;
  color: var(--color-heading);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  border: 1.25px solid var(--color-border);
  z-index: 10;
  pointer-events: none;
  max-width: 420px;
  width: max-content;
  white-space: normal;
  text-align: left;
  display: block;
}

.attachments-preview-format-toggle[data-tooltip]:hover::before,
.attachments-preview-format-toggle[data-tooltip]:focus-visible::before {
  content: "";
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 12px;
  transform: translateX(0);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #fff transparent;
  z-index: 10;
  pointer-events: none;
}

.attachments-preview-switch {
  position: relative;
  width: 44px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attachments-preview-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.attachments-preview-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.5);
  transition: background var(--transition-base);
}

.attachments-preview-switch-thumb {
  position: absolute;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.2);
  transition: transform var(--transition-base);
}

.attachments-preview-switch input:checked + .attachments-preview-switch-track {
  background: rgba(59, 130, 246, 0.6);
}

.attachments-preview-switch input:checked
  + .attachments-preview-switch-track
  + .attachments-preview-switch-thumb {
  transform: translateX(22px);
}

.attachments-preview-switch input:disabled + .attachments-preview-switch-track {
  background: rgba(148, 163, 184, 0.3);
}

.attachments-preview-switch input:disabled
  + .attachments-preview-switch-track
  + .attachments-preview-switch-thumb {
  opacity: 0.6;
}

.attachments-preview-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: var(--space-3);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.attachments-diff-modal .attachments-preview-body {
  gap: 0;
}

.attachments-diff-modal
  .modal-dialog.attachments-preview-dialog--compact
  .attachments-preview-body {
  padding-top: var(--attachments-header-offset, 54px);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  background: #f8fafc;
}

.attachments-diff-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
  min-height: 32px;
  overflow: visible;
  transition:
    max-height var(--transition-base),
    opacity var(--transition-base),
    margin var(--transition-base);
}

.attachments-diff-topbar .attachments-diff-topbar-content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  flex-wrap: nowrap;
  overflow: visible;
}

.attachments-diff-topbar .attachments-diff-version-controls {
  flex: 1 1 auto;
  max-width: min(540px, 34vw);
}

.attachments-diff-modal .attachments-diff-topbar {
  margin-top: max(
    0px,
    calc(
      var(--attachments-header-offset, 0px) 
      )
  );
}

.attachments-diff-title-row > .attachments-diff-topbar {
  order: 2;
  flex: 1 1 min(520px, 42vw);
  min-width: min(360px, 36vw);
  max-width: min(780px, 50vw);
  margin-top: 0;
}

.attachments-diff-topbar .attachments-diff-toolbar {
  flex: 1 1 auto;
  min-width: 0;
}

.attachments-diff-topbar .attachments-diff-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
}

.attachments-diff-topbar .attachments-diff-meta {
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 1 auto;
  min-width: 0;
}

.attachments-diff-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.attachments-preview-side {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-left: auto;
}

.attachments-preview-page-label {
  display: none;
  font-size: 0.75rem;
  color: #64748b;
}

.attachments-preview-side.is-pdf .attachments-preview-page-label {
  display: inline-flex;
  align-items: center;
}

.attachments-preview-modal .attachments-preview-side.is-floating,
.attachments-diff-modal .attachments-preview-side.is-floating {
  position: absolute;
  left: 50%;
  bottom: var(--space-4);
  transform: translateX(-50%);
  margin-left: 0;
  flex-wrap: nowrap;
  z-index: 6;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--space-1) var(--space-2);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
  opacity: 0.4;
  transition: opacity var(--transition-base), background var(--transition-base);
  max-width: calc(100% - var(--space-6));
  backdrop-filter: blur(6px);
}

.attachments-preview-modal .attachments-preview-side.is-floating:hover,
.attachments-preview-modal .attachments-preview-side.is-floating:focus-within,
.attachments-diff-modal .attachments-preview-side.is-floating:hover,
.attachments-diff-modal .attachments-preview-side.is-floating:focus-within {
  opacity: 1;
  background: rgba(248, 250, 252, 0.98);
}

.attachments-preview-modal .attachments-preview-side.is-floating,
.attachments-diff-modal .attachments-preview-side.is-floating {
  gap: var(--space-2);
}

.attachments-preview-modal .attachments-preview-side.is-floating .attachments-search-input,
.attachments-diff-modal .attachments-preview-side.is-floating .attachments-search-input {
  width: min(200px, 32vw);
  padding: 4px 10px;
  font-size: 0.85rem;
}

.attachments-preview-modal .attachments-preview-side.is-floating .attachments-search-count,
.attachments-diff-modal .attachments-preview-side.is-floating .attachments-search-count {
  min-width: 42px;
  font-size: 0.75rem;
}

.attachments-preview-modal .attachments-preview-side.is-floating .ghost-button,
.attachments-diff-modal .attachments-preview-side.is-floating .ghost-button {
  min-width: 42px;
  padding: 4px 8px;
  font-size: 0.85rem;
}

.attachments-preview-side.is-header {
  margin-left: 0;
}

.attachments-preview-modal .attachments-preview-side.is-header {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.attachments-diff-modal .attachments-diff-header-side {
  flex: 0 1 auto;
  justify-content: flex-start;
  min-width: 0;
  margin-left: 0;
  order: 3;
}

.attachments-diff-modal .attachments-preview-side.is-header {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.attachments-diff-modal .attachments-preview-side.is-header .attachments-search-input {
  width: var(--attachments-search-input-ch, 9.5ch);
  max-width: min(var(--attachments-search-input-max-ch, 30ch), 20vw);
}

.attachments-preview-toolbar-overflow {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.attachments-preview-toolbar-overflow[hidden] {
  display: none !important;
}

.attachments-preview-toolbar-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #52525b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.attachments-preview-toolbar-more[hidden] {
  display: none !important;
}

.attachments-preview-toolbar-more:hover,
.attachments-preview-toolbar-more:focus-visible,
.attachments-preview-toolbar-more[aria-expanded="true"] {
  background: rgba(226, 232, 240, 0.82);
  outline: none;
}

.attachments-preview-toolbar-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 12;
  min-width: 188px;
  max-width: min(260px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.attachments-preview-toolbar-menu[hidden] {
  display: none !important;
}

.attachments-preview-toolbar-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3f3f46;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
  text-align: left;
}

.attachments-preview-toolbar-menu-item[hidden] {
  display: none !important;
}

.attachments-preview-toolbar-menu-item:hover,
.attachments-preview-toolbar-menu-item:focus-visible,
.attachments-preview-toolbar-menu-item.is-active {
  background: rgba(226, 232, 240, 0.86);
  outline: none;
}

.attachments-preview-toolbar-menu-item:disabled {
  color: #a1a1aa;
  cursor: not-allowed;
  background: transparent;
}

.attachments-preview-toolbar-menu-item.is-loading {
  color: #2563eb;
  cursor: progress;
}

.attachments-preview-toolbar-menu-item.is-loading::before,
.attachments-preview-toolbar [data-preview-outline-toggle].is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: button-spin 0.7s linear infinite;
}

.attachments-preview-toolbar-menu-item.is-loading::before {
  margin-right: 8px;
}

.attachments-preview-toolbar [data-preview-outline-toggle].is-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  cursor: progress;
}

.attachments-preview-toolbar .attachments-zoom-group,
.attachments-preview-toolbar .attachments-search-group,
.attachments-preview-toolbar > .ghost-button,
.attachments-preview-toolbar .attachments-preview-page-label {
  flex: 0 0 auto;
}

.attachments-preview-toolbar .attachments-zoom-group,
.attachments-preview-toolbar .attachments-search-group {
  min-height: 32px;
  padding: 2px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.attachments-preview-toolbar .attachments-zoom-group {
  gap: 0;
}

.attachments-preview-toolbar .ghost-button,
.attachments-preview-toolbar .attachments-search-toggle {
  min-width: 30px;
  min-height: 28px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #3f3f46;
  box-shadow: none;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.attachments-preview-toolbar .attachments-zoom-group .ghost-button {
  min-width: 30px;
  padding: 0 8px;
  border-radius: 0;
}

.attachments-preview-toolbar .attachments-zoom-group .ghost-button:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.attachments-preview-toolbar .attachments-zoom-group .ghost-button:last-child {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

.attachments-preview-toolbar .attachments-zoom-group .ghost-button + .ghost-button {
  border-left: 1px solid rgba(148, 163, 184, 0.2);
}

.attachments-preview-toolbar [data-preview-zoom-reset] {
  min-width: 48px;
  font-size: 0.72rem;
  font-weight: 700;
}

.attachments-preview-toolbar .ghost-button:hover:not(:disabled),
.attachments-preview-toolbar .ghost-button:focus-visible,
.attachments-preview-toolbar .attachments-search-toggle:hover,
.attachments-preview-toolbar .attachments-search-toggle:focus-visible,
.attachments-preview-format-toggle:hover,
.attachments-preview-format-toggle:focus-visible {
  background: rgba(226, 232, 240, 0.82);
  outline: none;
}

.attachments-preview-toolbar .ghost-button.is-active,
.attachments-preview-toolbar .ghost-button[aria-pressed="true"] {
  background: rgba(212, 219, 228, 0.86);
  color: #18181b;
}

.attachments-preview-toolbar .ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.attachments-preview-toolbar > .ghost-button {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

.attachments-preview-toolbar .attachments-search-input {
  width: var(--attachments-search-input-ch, 9.5ch);
  min-width: 15.5ch;
  max-width: min(var(--attachments-search-input-max-ch, 30ch), 22vw);
  min-height: 28px;
  padding: 4px 9px;
  border: 0;
  background: rgba(244, 246, 248, 0.86);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
  transition: width var(--transition-fast), max-width var(--transition-fast);
}

.attachments-preview-toolbar .attachments-search-actions .ghost-button {
  min-width: 28px;
  padding: 0 7px;
}

.attachments-preview-toolbar .attachments-search-count {
  min-width: 42px;
  color: #71717a;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}

.attachments-preview-toolbar .attachments-preview-page-label {
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #52525b;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (hover: none), (pointer: coarse) {
  .attachments-preview-modal .modal-dialog.attachments-preview-dialog--compact .modal-header,
  .attachments-preview-modal .modal-header .modal-title-block {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .attachments-preview-modal .modal-header button,
  .attachments-preview-format-toggle,
  .attachments-preview-toolbar-more,
  .attachments-preview-toolbar-menu-item,
  .attachments-preview-toolbar .ghost-button,
  .attachments-preview-toolbar .attachments-search-toggle,
  .attachments-search-clear {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .attachments-preview-toolbar .attachments-zoom-group,
  .attachments-preview-toolbar .attachments-search-group {
    min-height: 36px;
  }

  .attachments-preview-format-toggle,
  .attachments-preview-toolbar-more,
  .attachments-preview-toolbar .ghost-button,
  .attachments-preview-toolbar .attachments-search-toggle {
    min-width: 34px;
    min-height: 32px;
    height: 32px;
  }

  .attachments-preview-toolbar [data-preview-zoom-reset] {
    min-width: 52px;
  }

  .attachments-preview-toolbar-menu-item {
    min-height: 40px;
    font-size: 0.88rem;
  }

  .attachments-preview-toolbar .attachments-search-input {
    min-height: 32px;
  }

  .attachments-preview-modal .attachments-search-clear {
    width: 24px;
    height: 24px;
    right: 4px;
  }

  .attachments-preview-modal .attachments-search-group.has-query .attachments-search-input {
    padding-right: 34px;
  }

  .attachments-preview-modal .modal-header input,
  .attachments-preview-modal .modal-header textarea {
    -webkit-user-select: text;
    user-select: text;
  }
}

.attachments-preview-header-side[data-preview-toolbar-mode="compact"] {
  gap: 6px;
}

.attachments-preview-header-side[data-preview-toolbar-mode="compact"]
  .attachments-preview-page-label {
  display: none !important;
}

.attachments-preview-header-side[data-preview-toolbar-mode="compact"]
  .attachments-preview-toolbar {
  gap: 6px;
}

.attachments-preview-header-side[data-preview-toolbar-mode="compact"]
  .attachments-preview-toolbar
  .attachments-search-input {
  width: var(--attachments-search-input-ch, 9.5ch);
  max-width: min(var(--attachments-search-input-max-ch, 30ch), 18vw);
}

.attachments-preview-modal[data-preview-toolbar-mode="compact"]
  .modal-header
  .modal-title-block {
  flex-basis: 180px;
  max-width: min(300px, 28vw);
}

.attachments-preview-header-side[data-preview-toolbar-mode="condensed"],
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"] {
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.attachments-preview-header-side[data-preview-toolbar-mode="condensed"]
  [data-preview-format-group],
.attachments-preview-header-side[data-preview-toolbar-mode="condensed"]
  .attachments-zoom-group,
.attachments-preview-header-side[data-preview-toolbar-mode="condensed"]
  .attachments-preview-page-label,
.attachments-preview-header-side[data-preview-toolbar-mode="condensed"]
  [data-preview-outline-toggle],
.attachments-preview-header-side[data-preview-toolbar-mode="condensed"]
  [data-pdf-panel-toggle],
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"]
  [data-preview-format-group],
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"]
  .attachments-zoom-group,
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"]
  .attachments-preview-page-label,
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"]
  [data-preview-outline-toggle],
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"]
  [data-pdf-panel-toggle] {
  display: none !important;
}

.attachments-preview-header-side[data-preview-toolbar-mode="condensed"]
  .attachments-preview-toolbar,
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"]
  .attachments-preview-toolbar {
  flex: 0 1 auto;
  justify-content: flex-end;
  min-width: 0;
  width: auto;
}

.attachments-preview-header-side[data-preview-toolbar-mode="condensed"]
  .attachments-search-group,
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"]
  .attachments-search-group {
  flex: 0 1 auto;
  min-width: 0;
}

.attachments-preview-header-side[data-preview-toolbar-mode="condensed"]
  .attachments-search-group.is-open,
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"]
  .attachments-search-group.is-open {
  flex: 0 1 auto;
  max-width: min(420px, 100%);
  min-width: 0;
  border-color: rgba(236, 72, 153, 0.62);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.attachments-preview-header-side[data-preview-toolbar-mode="condensed"]
  .attachments-search-group.is-open
  .attachments-search-input,
.attachments-preview-header-side[data-preview-toolbar-mode="minimal"]
  .attachments-search-group.is-open
  .attachments-search-input {
  flex: 0 0 auto;
  width: var(--attachments-search-input-ch, 9.5ch);
  max-width: min(var(--attachments-search-input-max-ch, 30ch), 34vw);
  min-width: 0;
}

.attachments-preview-modal[data-preview-toolbar-mode="condensed"]
  .modal-header
  .modal-title-block,
.attachments-preview-modal[data-preview-toolbar-mode="minimal"]
  .modal-header
  .modal-title-block {
  flex: 1 1 150px;
  max-width: min(260px, 36vw);
}

.attachments-preview-modal[data-preview-toolbar-mode="minimal"]
  .modal-header
  .modal-title-block {
  flex-basis: 112px;
  max-width: min(210px, 34vw);
}

.attachments-preview-side.is-header .attachments-search-input {
  width: var(--attachments-search-input-ch, 9.5ch);
  max-width: min(var(--attachments-search-input-max-ch, 30ch), 28vw);
}

.attachments-search-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
}

.attachments-search-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.attachments-search-toggle svg {
  width: 16px;
  height: 16px;
}

.attachments-search-group:not(.is-open) {
  gap: 0;
}

.attachments-search-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

.attachments-search-group:not(.is-open) .attachments-search-input,
.attachments-search-group:not(.is-open) .attachments-search-field,
.attachments-search-group:not(.is-open) .attachments-search-actions {
  display: none;
}

.attachments-search-group.is-open:not(.has-results) .attachments-search-actions {
  display: none;
}

.attachments-search-group.is-open:not(.has-query) .attachments-search-input {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

.attachments-preview-header-side[data-preview-toolbar-mode]
  .attachments-search-group.is-open:not(.has-query)
  .attachments-search-input {
  flex: 0 0 auto;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

.attachments-search-group.is-open .attachments-search-toggle {
  background: rgba(226, 232, 240, 0.7);
}

.attachments-search-input {
  width: var(--attachments-search-input-ch, 9.5ch);
  min-width: 8.5ch;
  max-width: min(var(--attachments-search-input-max-ch, 30ch), 40vw);
  border-radius: var(--radius-lg);

}

.attachments-search-group.has-query .attachments-search-input {
  padding-right: 30px;
}

.attachments-search-clear {
  position: absolute;
  top: 50%;
  right: 5px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
  color: #52525b;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}

.attachments-search-group.is-open.has-query .attachments-search-clear {
  display: inline-flex;
}

.attachments-search-clear:hover,
.attachments-search-clear:focus-visible {
  background: rgba(100, 116, 139, 0.32);
  color: #18181b;
  outline: none;
}

.attachments-search-clear:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.attachments-search-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.attachments-search-count {
  min-width: 56px;
  text-align: center;
}

@media (max-width: 860px) {
  .attachments-preview-modal .modal-dialog.attachments-preview-dialog--compact .modal-header {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .attachments-preview-modal .modal-header .modal-title-block {
    flex: 1 1 150px;
    max-width: min(260px, 34vw);
  }

  .attachments-preview-modal .modal-header .attachments-preview-header-side {
    order: 2;
    flex: 1 1 auto;
    justify-content: flex-start;
    margin-left: 0;
    overflow: visible;
    padding-bottom: 0;
    scrollbar-width: none;
  }

  .attachments-preview-header-side::-webkit-scrollbar {
    display: none;
  }

  .attachments-preview-modal .attachments-preview-side.is-header {
    width: auto;
  }

  .attachments-preview-toolbar .attachments-search-input {
    width: var(--attachments-search-input-ch, 9.5ch);
    max-width: min(var(--attachments-search-input-max-ch, 30ch), 42vw);
  }
}

.attachments-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.attachments-zoom-group .ghost-button {
  min-width: 54px;
}

.attachments-preview-tabs {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.attachments-preview-tabs .ghost-button.is-active {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.2);
}

.attachments-zoom-group .ghost-button.is-active {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.2);
}

mark.attachments-search-hit {
  background: rgba(253, 224, 71, 0.7);
  color: inherit;
  padding: 0 0.1em;
  border-radius: 4px;
}

mark.attachments-search-hit.is-active {
  background: rgba(245, 158, 11, 0.85);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.4);
}

.attachments-preview-panel {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.attachments-preview-frame {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.attachments-preview-splash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 2;
}

.attachments-preview-splash.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.attachments-preview-splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
  text-align: center;
  min-width: 220px;
}

.attachments-preview-splash-icon {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #1d4ed8;
}

.attachments-preview-splash-icon svg {
  width: 96px;
  height: 96px;
}

.attachments-preview-splash[data-type="docx"] .attachments-preview-splash-icon {
  background: #dcfce7;
  color: #15803d;
}

.attachments-preview-splash[data-type="pdf"] .attachments-preview-splash-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.attachments-preview-splash-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.attachments-preview-splash-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.95rem;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-preview-splash-status {
  font-size: 0.8rem;
  color: #64748b;
}

.attachments-pdf-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  min-height: 0;
}

.attachments-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.attachments-pdf-body {
  position: relative;
  display: flex;
  gap: var(--space-3);
  flex: 1;
  min-height: 0;
}

.attachments-pdf-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.attachments-pdf-group .ghost-button.is-active {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.2);
}

.attachments-pdf-viewer {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius-md) + 8px);
  background: #f8fafc;
}

.attachments-pdf-pages {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100%;
  width: fit-content;
  min-height: 100%;
  margin: 0 auto;
}

.attachments-pdf-panel {
  width: min(320px, 40vw);
  min-width: 240px;
  max-width: 420px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-2);
  overflow: auto;
}

.attachments-annotation-panel {
  position: absolute;
  top: 72px;
  right: var(--space-4);
  z-index: 7;
  max-height: calc(100% - 120px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.attachments-preview-modal .attachments-annotation-panel {
  top: calc(var(--attachments-header-offset, 56px) + var(--space-2));
  max-height: calc(100% - var(--attachments-header-offset, 56px) - var(--space-4));
}

.attachments-pdf-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.attachments-pdf-panel-title {
  font-weight: 700;
}

.attachments-pdf-panel-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.attachments-pdf-panel-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.attachments-pdf-panel-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.attachments-pdf-panel-item {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2);
  overflow: hidden;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.attachments-pdf-panel-item:hover {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.16);
}

.attachments-pdf-panel-item-action {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.attachments-pdf-panel-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 4px;
}

.attachments-pdf-panel-item-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #e2e8f0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.attachments-pdf-panel-item-avatar.has-avatar {
  background-color: #fff;
  color: transparent;
}

.attachments-pdf-panel-item-title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-pdf-panel-item-page {
  flex: 0 0 auto;
  max-width: 72px;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-pdf-panel-item-excerpt {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #334155;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.attachments-pdf-panel-item-meta {
  flex: 0 1 42%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  line-height: 1.15;
}

.attachments-pdf-panel-item-meta-name,
.attachments-pdf-panel-item-meta-time {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-pdf-panel-item-meta-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}

.attachments-pdf-panel-item-meta-time {
  font-size: 0.7rem;
  color: #64748b;
}

.attachments-pdf-panel-item-delete {
  border: none;
  background: rgba(239, 68, 68, 0.01);
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px;
  border-radius: 16px;
  cursor: pointer;
  align-self: flex-start;
}

.attachments-pdf-panel-item-delete:hover {
  background: rgba(239, 68, 68, 0.1);
}

.attachments-pdf-panel-item-review {
  flex: 1 0 100%;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: 6px;
  min-width: 0;
}

.attachments-pdf-panel-item-review-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
}

.attachments-pdf-panel-item-review-summary::-webkit-details-marker {
  display: none;
}

.attachments-pdf-panel-item-review-summary::before {
  content: "›";
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform var(--transition-base);
}

.attachments-pdf-panel-item-review[open] .attachments-pdf-panel-item-review-summary::before {
  transform: rotate(90deg);
}

.attachments-pdf-panel-item-review-status {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
}

.attachments-pdf-panel-item-review-status.is-ready {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.attachments-pdf-panel-item-review-body {
  display: grid;
  gap: 5px;
  padding: 7px 0 1px 18px;
}

.attachments-pdf-panel-item-review-heading {
  color: #0f172a;
  font-size: 0.76rem;
  font-weight: 700;
}

.attachments-pdf-panel-item-review-message {
  margin: 0;
  color: #334155;
  font-size: 0.76rem;
  line-height: 1.35;
}

.attachments-pdf-panel-item-review-meta,
.attachments-pdf-panel-item-review-decision {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
  padding: 6px 7px;
}

.attachments-pdf-panel-item-review-line {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  min-width: 0;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.25;
}

.attachments-pdf-panel-item-review-label {
  flex: 0 0 auto;
}

.attachments-pdf-panel-item-review-value {
  min-width: 0;
  color: #0f172a;
  font-weight: 700;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-pdf-panel-empty {
  padding: 6px 2px;
  font-size: 0.85rem;
}

.attachments-pdf-page {
  position: relative;
  flex: 0 0 auto;
  margin: 0 0 var(--space-3);
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  user-select: text;
}

.attachments-pdf-canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.attachments-pdf-canvas.is-front {
  opacity: 1;
}

.attachments-pdf-canvas.is-buffer {
  opacity: 0;
}

.attachments-pdf-text-layer {
  position: absolute;
  inset: 0;
  color: transparent;
  transform-origin: 0 0;
  user-select: text;
  cursor: text;
  z-index: 1;
  pointer-events: auto;
  line-height: 1;
  text-align: initial;
  overflow: hidden;
  transition: opacity 120ms ease;
}

.attachments-pdf-text-layer.is-front {
  opacity: 1;
}

.attachments-pdf-text-layer.is-buffer {
  opacity: 0;
  pointer-events: none;
}

.attachments-pdf-text-layer span,
.attachments-pdf-text-layer br {
  position: absolute;
  white-space: pre;
  transform-origin: 0 0;
  cursor: text;
  line-height: 1;
  margin: 0;
  padding: 0;
  color: transparent;
}

.attachments-pdf-text-layer ::selection {
  background: rgba(253, 224, 71, 0.4);
}

.attachments-pdf-text-layer .endOfContent {
  display: block;
  position: absolute;
  left: 0;
  top: 100%;
  right: 0;
  height: 1px;
  z-index: -1;
  cursor: text;
  user-select: none;
}

.attachments-pdf-text-layer .endOfContent.active {
  top: 0;
}

.attachments-pdf-annotations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.attachments-pdf-highlight,
.attachments-docx-highlight {
  position: absolute;
  background: rgba(250, 204, 21, 0.5);
  border-radius: 4px;
  mix-blend-mode: multiply;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
}

.attachments-pdf-highlight.is-note,
.attachments-docx-highlight.is-note {
  background: rgba(250, 204, 21, 0.5);
}

.attachments-preview-modal:not(.attachments-preview-annotations-visible)
  .attachments-docx-highlight.is-note,
.attachments-preview-modal:not(.attachments-preview-annotations-visible)
  .attachments-docx-note {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.attachments-pdf-highlight.is-pending,
.attachments-docx-highlight.is-pending {
  background: rgba(59, 130, 246, 0.2);
  border: 1px dashed rgba(37, 99, 235, 0.7);
  mix-blend-mode: normal;
}

.attachments-pdf-highlight.is-focus,
.attachments-docx-highlight.is-focus {
  outline: 2px solid rgba(34, 197, 94, 0.8);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.attachments-docx-proofread-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.attachments-docx-highlight.is-proofread {
  border: 0;
  border-bottom: 2px solid rgba(220, 38, 38, 0.95);
  border-radius: 0;
  background: rgba(254, 226, 226, 0.34);
  mix-blend-mode: normal;
  pointer-events: none;
}

.attachments-docx-highlight.is-proofread.is-ambiguous {
  border-bottom-color: rgba(37, 99, 235, 0.9);
  background: rgba(219, 234, 254, 0.28);
}

.attachments-docx-highlight.is-proofread.is-model {
  border-bottom-color: rgba(217, 119, 6, 0.95);
  background: rgba(254, 243, 199, 0.34);
}

.attachments-docx-highlight.is-proofread.is-focus {
  outline: 2px solid rgba(37, 99, 235, 0.72);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.attachments-pdf-note,
.attachments-docx-note {
  position: absolute;
  transform: translate(-50%, -50%);
  width: var(--note-size, 48px);
  height: var(--note-size, 48px);
  aspect-ratio: 1 / 1;
  padding: 0;
  box-sizing: border-box;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 3;
}

.attachments-pdf-note::after,
.attachments-docx-note::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: var(--note-line-length, 12px);
  border-top: 1px dashed rgba(15, 23, 42, 0.35);
  transform: translateY(-50%);
  pointer-events: none;
}

.attachments-pdf-note-badge,
.attachments-docx-note-badge {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--note-size, 48px) * 0.23);
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  background-clip: padding-box;
  -webkit-mask-image: radial-gradient(circle, #fff 98%, transparent 100%);
  mask-image: radial-gradient(circle, #fff 98%, transparent 100%);
  clip-path: circle(50% at 50% 50%);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.2);
}

.attachments-docx-note-badge {
  opacity: 0.42;
  transition:
    opacity 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.attachments-docx-note:hover .attachments-docx-note-badge,
.attachments-docx-note:focus .attachments-docx-note-badge,
.attachments-docx-note:focus-within .attachments-docx-note-badge,
.attachments-docx-note.is-focus .attachments-docx-note-badge {
  opacity: 1;
  transform: scale(1.02);
}

.attachments-pdf-note.has-avatar,
.attachments-docx-note.has-avatar {
  background: transparent;
}

.attachments-pdf-note.has-avatar .attachments-pdf-note-badge,
.attachments-docx-note.has-avatar .attachments-docx-note-badge {
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: transparent;
  border: 1px solid rgba(15, 23, 42, 0.18);
}

.attachments-pdf-note.is-muted,
.attachments-docx-note.is-muted {
  opacity: 0.45;
}

.attachments-pdf-note.is-focus .attachments-pdf-note-badge,
.attachments-docx-note.is-focus .attachments-docx-note-badge {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3), 0 10px 18px rgba(15, 23, 42, 0.2);
}

.attachments-pdf-note:focus,
.attachments-docx-note:focus {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 2px;
}

.attachments-diff-docx .attachments-docx-diff-note {
  z-index: 4;
}

.attachments-pdf-note-popover {
  position: absolute;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.35);
  transform: translate(-50%, -100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.attachments-pdf-note-popover.is-visible {
  opacity: 1;
}


.attachments-preview-error {
  color: #b91c1c;
}

.attachments-docx-style {
  display: none;
}

.attachments-docx-preview-shell {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  min-width: 0;
  gap: var(--space-3);
  align-items: stretch;
}

.attachments-docx-preview {
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0.25px solid var(--color-border);
  border-radius: calc(var(--radius-lg) + 8px);
  background: #fff;
  overflow: auto;
  max-height: none;
  position: relative;
  font-kerning: normal;
  font-variant-ligatures: normal;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

.attachments-docx-preview .docx-wrapper {
  background: transparent !important;
  padding: 0 !important;
  padding-bottom: var(--space-3) !important;
}

.attachments-docx-preview .docx-wrapper > section.docx {
  background: #fff !important;
  box-shadow: none !important;
  border: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: var(--space-3) !important;
}

.attachments-docx-outline-panel {
  position: relative;
  width: var(--attachments-docx-outline-width, min(300px, 32vw));
  min-width: 240px;
  max-width: min(520px, 50vw);
  flex: 0 0 auto;
  align-self: flex-start;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-3);
  min-height: 0;
  margin-top: var(--attachments-header-offset, 0px);
  height: calc(100vh - var(--attachments-header-offset, 0px) - var(--space-5));
  max-height: calc(100vh - var(--attachments-header-offset, 0px) - var(--space-5));
  padding: var(--space-3);
  padding-right: calc(var(--space-3) + 6px);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: calc(var(--radius-lg) + 8px);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.94));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.attachments-preview-modal .attachments-docx-preview-shell {
  gap: 0;
}

.attachments-preview-modal
  .attachments-docx-preview-shell--outline-open:not(.attachments-docx-preview-shell--outline-drawer) {
  gap: var(--space-3);
}

.attachments-preview-modal .attachments-docx-outline-panel {
  position: relative;
  inset: auto;
  z-index: 5;
  box-sizing: border-box;
  flex: 0 0 var(--attachments-docx-outline-width, min(300px, 32vw));
  align-self: stretch;
  margin-top: 0;
  height: 100%;
  max-height: 100%;
}

.attachments-docx-outline-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 14px;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.attachments-docx-preview-shell--outline-resizing,
.attachments-docx-preview-shell--outline-resizing * {
  cursor: col-resize !important;
  user-select: none;
  -webkit-user-select: none;
}

.attachments-docx-preview-shell--outline-resizing::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 8;
  width: 3px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.72);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 0 0 4px rgba(37, 99, 235, 0.14);
  pointer-events: none;
  transform: translate3d(
    calc(var(--attachments-docx-outline-resize-preview-x, 0px) - 1.5px),
    0,
    0
  );
  will-change: transform;
}

.attachments-docx-outline-resize-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 4px;
  width: 4px;
  height: 52px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.18), rgba(100, 116, 139, 0.52));
  box-shadow: inset 0 0 0 1px rgba(71, 85, 105, 0.12);
  opacity: 0.55;
  transition:
    opacity var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.attachments-docx-outline-resize-handle:hover::before,
.attachments-docx-outline-resize-handle:focus-visible::before,
.attachments-docx-preview-shell--outline-resizing
  .attachments-docx-outline-resize-handle::before {
  opacity: 1;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.68));
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.attachments-docx-outline-resize-handle:focus-visible {
  outline: none;
}

.attachments-docx-outline-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 6px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
}

.attachments-docx-outline-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.attachments-preview-side-panel-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.attachments-preview-side-panel-tab {
  border: 0;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 10px;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.attachments-preview-side-panel-tab:hover,
.attachments-preview-side-panel-tab:focus-visible {
  background: rgba(226, 232, 240, 0.72);
  color: #0f172a;
  outline: none;
}

.attachments-preview-side-panel-tab.is-active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.attachments-preview-side-panel-panes {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.attachments-preview-side-panel-pane {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.attachments-preview-side-panel-pane[hidden],
.attachments-preview-side-panel-pane[aria-hidden="true"] {
  display: none;
}

.attachments-preview-side-panel-pane--notes .attachments-pdf-panel-section {
  flex: 1 1 0;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.attachments-preview-side-panel-pane--notes .attachments-pdf-panel-list {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.attachments-preview-side-panel-pane--proofread {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.attachments-docx-proofread-panel {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.attachments-docx-proofread-status {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.35;
}

.attachments-docx-proofread-settings {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.attachments-docx-proofread-threshold {
  align-items: center;
  color: #334155;
  display: flex;
  flex: 1 1 auto;
  font-size: 0.78rem;
  font-weight: 650;
  gap: 0.5rem;
  justify-content: space-between;
  min-width: 0;
}

.attachments-docx-proofread-threshold select {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: var(--radius-sm);
  color: #0f172a;
  font: inherit;
  min-height: 30px;
  min-width: 76px;
  padding: 0.24rem 0.45rem;
}

.attachments-docx-proofread-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.attachments-docx-proofread-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachments-docx-proofread-section-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.attachments-docx-proofread-section-hint {
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.35;
}

.attachments-docx-proofread-item {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 10px;
  text-align: left;
}

.attachments-docx-proofread-item.is-model {
  border-color: rgba(217, 119, 6, 0.34);
  background: rgba(255, 251, 235, 0.9);
}

.attachments-docx-proofread-item:hover,
.attachments-docx-proofread-item:focus-visible,
.attachments-docx-proofread-item.is-active {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
  outline: none;
}

.attachments-docx-proofread-item.is-model:hover,
.attachments-docx-proofread-item.is-model:focus-visible,
.attachments-docx-proofread-item.is-model.is-active {
  border-color: rgba(217, 119, 6, 0.62);
  box-shadow: 0 8px 18px rgba(217, 119, 6, 0.14);
}

.attachments-docx-proofread-item-main {
  align-items: flex-start;
  color: #0f172a;
  display: flex;
  font-size: 0.88rem;
  font-weight: 650;
  gap: 8px;
  justify-content: space-between;
  line-height: 1.35;
  min-width: 0;
}

.attachments-docx-proofread-item-main-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.attachments-docx-proofread-confidence {
  color: #475569;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  white-space: nowrap;
}

.attachments-docx-proofread-arrow {
  color: #64748b;
  padding: 0 5px;
}

.attachments-docx-proofread-context {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.attachments-docx-proofread-context-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.attachments-docx-proofread-context-text {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.attachments-docx-proofread-context-mark {
  background: rgba(254, 240, 138, 0.75);
  border-radius: 3px;
  color: #713f12;
  font-weight: 800;
  padding: 0 2px;
}

.attachments-docx-proofread-item.is-model .attachments-docx-proofread-context-mark {
  background: rgba(253, 186, 116, 0.62);
  color: #7c2d12;
}

.attachments-docx-proofread-item-meta,
.attachments-docx-proofread-empty {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

.attachments-docx-proofread-empty {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.attachments-docx-proofread-empty-action {
  align-self: flex-start;
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
}

.attachments-docx-outline-body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.attachments-docx-outline-item {
  --docx-outline-level: 1;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin-inline-start: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: #334155;
  text-align: left;
  cursor: pointer;
  padding: 10px 12px;
  font-family: var(--docx-outline-font-family, inherit);
  font-style: var(--docx-outline-font-style, normal);
  text-transform: var(--docx-outline-text-transform, none);
  letter-spacing: var(--docx-outline-letter-spacing, normal);
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.attachments-docx-outline-item::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin-top: 0.48em;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.18);
  justify-self: center;
  flex-shrink: 0;
}

.attachments-docx-outline-item[data-docx-outline-level="1"]::before {
  width: 10px;
  height: 10px;
  margin-top: 0.42em;
  background: rgba(59, 130, 246, 0.85);
  box-shadow: none;
}

.attachments-docx-outline-item[data-docx-outline-level="2"]::before {
  width: 8px;
  height: 8px;
  background: rgba(59, 130, 246, 0.55);
  box-shadow: none;
}

.attachments-docx-outline-item[data-docx-outline-level="3"]::before,
.attachments-docx-outline-item[data-docx-outline-level="4"]::before,
.attachments-docx-outline-item[data-docx-outline-level="5"]::before,
.attachments-docx-outline-item[data-docx-outline-level="6"]::before {
  width: 10px;
  height: 2px;
  margin-top: 0.72em;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.72);
  box-shadow: none;
}

.attachments-docx-outline-item:hover,
.attachments-docx-outline-item:focus-visible {
  background: rgba(226, 232, 240, 0.72);
  border-color: rgba(148, 163, 184, 0.28);
  color: #0f172a;
  outline: none;
}

.attachments-docx-outline-item.is-active {
  background: rgba(219, 234, 254, 0.92);
  border-color: rgba(59, 130, 246, 0.32);
  color: #1d4ed8;
}

.attachments-docx-outline-item-text {
  grid-column: 2;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
  font-size: 0.84rem;
  font-weight: var(--docx-outline-font-weight, 600);
}

.attachments-docx-outline-empty {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(226, 232, 240, 0.55);
  color: #64748b;
  font-size: 0.82rem;
}

.attachments-docx-outline-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(219, 234, 254, 0.62);
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 650;
}

.attachments-docx-outline-loading .attachments-inline-spinner {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

.attachments-docx-outline-scrim {
  display: none;
}

.attachments-docx-preview-shell--outline-resizing,
.attachments-docx-preview-shell--outline-resizing * {
  cursor: col-resize !important;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 960px) {
  .attachments-docx-preview-shell {
    gap: 0;
  }

  .attachments-docx-outline-panel {
    position: absolute;
    top: var(--attachments-header-offset, 0px);
    left: 0;
    bottom: 0;
    z-index: 5;
    margin-top: 0;
    height: calc(100% - var(--attachments-header-offset, 0px));
    max-height: calc(100% - var(--attachments-header-offset, 0px));
    width: min(78vw, 320px);
    min-width: min(78vw, 320px);
    max-width: min(78vw, 320px);
    border-radius: calc(var(--radius-md) + 8px);
    transform: translateX(calc(-100% - var(--space-3)));
    transition: transform var(--transition-base);
  }

  .attachments-preview-modal .attachments-docx-outline-panel,
  .attachments-preview-modal
    .attachments-docx-preview-shell--outline-drawer
    .attachments-docx-outline-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    flex: 0 0 auto;
    height: 100%;
    width: min(78vw, 320px);
    min-width: min(78vw, 320px);
    max-width: min(78vw, 320px);
    max-height: 100%;
  }

  .attachments-docx-outline-resize-handle {
    display: none;
  }

  .attachments-docx-preview-shell--outline-open .attachments-docx-outline-panel {
    transform: translateX(0);
  }

  .attachments-docx-outline-scrim {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: block;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
  }

  .attachments-docx-preview-shell--outline-open .attachments-docx-outline-scrim {
    opacity: 1;
    pointer-events: auto;
  }
}

.attachments-docx-preview-skeleton-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  padding: 0;
  transition: opacity 0.18s ease;
  isolation: isolate;
}

.attachments-diff-progress-pane.attachments-docx-preview-progress-pane.is-overlay {
  top: calc(var(--attachments-header-offset, 0px) + 14px);
  right: 14px;
  z-index: 31;
  width: min(340px, calc(100% - 28px));
  max-height: calc(100% - var(--attachments-header-offset, 0px) - 28px);
}

.attachments-preview-modal .attachments-diff-progress-pane.attachments-docx-preview-progress-pane.is-overlay {
  top: 14px;
  max-height: calc(100% - 28px);
}

.attachments-docx-preview.attachments-docx-preview--hydrating {
  opacity: 0.985;
}

.attachments-docx-preview section.docx {
  position: relative;
  overflow: visible;
  line-height: normal;
}

.attachments-docx-preview section.docx.attachments-docx-lazy {
  content-visibility: auto;
  contain-intrinsic-size: auto 1160px;
  contain: layout style paint;
  border-radius: var(--radius-lg);
  border: 0;


}

.attachments-docx-preview section.docx.attachments-docx-lazy.is-visible {
  content-visibility: visible;
  contain: layout style;
}

.attachments-docx-annotations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.attachments-docx-preview article {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.attachments-docx-preview header,
.attachments-docx-preview footer,
.attachments-docx-preview table,
.attachments-docx-preview th,
.attachments-docx-preview td,
.attachments-docx-preview p::before {
  font-family: inherit;
}

.attachments-docx-preview table.attachments-docx-table-auto {
  table-layout: auto;
  width: 100%;
}

.attachments-docx-preview table.attachments-docx-table-auto td,
.attachments-docx-preview table.attachments-docx-table-auto th {
  width: auto;
}

.attachments-docx-preview .attachments-docx-toc-fallback {
  min-height: 0;
}

.attachments-docx-preview .attachments-docx-toc-fallback-list {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.attachments-docx-preview .attachments-docx-toc-fallback-item {
  margin: 0;
  padding-left: 0;
}

.attachments-docx-preview
  .attachments-docx-toc-fallback-item[data-docx-toc-level="1"] {
  padding-left: 0;
}

.attachments-docx-preview
  .attachments-docx-toc-fallback-item[data-docx-toc-level="2"] {
  padding-left: 18px;
}

.attachments-docx-preview
  .attachments-docx-toc-fallback-item[data-docx-toc-level="3"] {
  padding-left: 36px;
}

.attachments-docx-preview .attachments-docx-toc-fallback-link {
  color: inherit;
  display: inline-block;
  text-decoration: none;
}

.attachments-docx-preview .attachments-docx-toc-fallback-link:hover,
.attachments-docx-preview .attachments-docx-toc-fallback-link:focus-visible {
  text-decoration: underline;
}

.attachments-docx-preview td,
.attachments-docx-preview th {
  min-width: 0;
}

.attachments-docx-preview td *,
.attachments-docx-preview th * {
  max-width: 100%;
}

.attachments-docx-preview td.attachments-docx-cell-overflow,
.attachments-docx-preview th.attachments-docx-cell-overflow {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.attachments-docx-preview td.attachments-docx-cell-overflow > p,
.attachments-docx-preview th.attachments-docx-cell-overflow > p {
  white-space: normal !important;
}

.attachments-docx-preview td.attachments-docx-cell-overflow *,
.attachments-docx-preview th.attachments-docx-cell-overflow * {
  white-space: normal !important;
}

.attachments-docx-preview td.attachments-docx-align-left,
.attachments-docx-preview th.attachments-docx-align-left {
  text-align: left;
}

.attachments-docx-preview td.attachments-docx-align-left > p,
.attachments-docx-preview th.attachments-docx-align-left > p {
  text-align: left !important;
  text-align-last: left !important;
}

.attachments-docx-preview td.attachments-docx-align-center,
.attachments-docx-preview th.attachments-docx-align-center {
  text-align: center;
}

.attachments-docx-preview td.attachments-docx-align-center > p,
.attachments-docx-preview th.attachments-docx-align-center > p {
  text-align: center !important;
  text-align-last: center !important;
}

.attachments-docx-preview td.attachments-docx-index-col,
.attachments-docx-preview th.attachments-docx-index-col {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  min-width: 2.2em;
  text-align: center;
  text-align-last: center;
  vertical-align: middle;
}

.attachments-docx-preview td.attachments-docx-index-col > p,
.attachments-docx-preview th.attachments-docx-index-col > p {
  white-space: nowrap !important;
  text-align: center !important;
  text-align-last: center !important;
}

.attachments-docx-preview td.attachments-docx-align-right,
.attachments-docx-preview th.attachments-docx-align-right {
  text-align: right;
}

.attachments-docx-preview td.attachments-docx-align-right > p,
.attachments-docx-preview th.attachments-docx-align-right > p {
  text-align: right !important;
  text-align-last: right !important;
}

.attachments-docx-preview p.attachments-docx-justify {
  text-justify: inter-word;
  text-align-last: left;
}

.attachments-docx-preview p[data-docx-justify-normalized="short-body-label"],
.attachments-docx-preview p[data-docx-justify-normalized="short-table-label"] {
  text-align: left !important;
  text-align-last: left !important;
}

.attachments-docx-preview.is-optimized p,
.attachments-docx-preview.is-optimized table {
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

.attachments-diff-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
}

.attachments-diff-controls .form-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 220px;
  min-width: 0;
}

.attachments-diff-controls .form-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.attachments-diff-controls .form-field select {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-diff-controls .attachments-diff-field--base select,
.attachments-diff-controls .attachments-diff-field--target select {
  padding-left: 36px;
  background-repeat: no-repeat;
  background-position: 14px 50%;
  background-size: 10px 10px;
}

.attachments-diff-controls .attachments-diff-field--base select {
  background-image: radial-gradient(circle, rgba(239, 68, 68, 0.9) 0 4px, transparent 5px);
}

.attachments-diff-controls .attachments-diff-field--target select {
  background-image: radial-gradient(circle, rgba(34, 197, 94, 0.9) 0 4px, transparent 5px);
}

.attachments-diff-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  padding-right: 12px;
  flex-wrap: nowrap;
}

.attachments-diff-title-row h3 {
  order: 1;
  flex: 0 0 auto;
  min-width: 140px;
  max-width: min(220px, 20vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-diff-title-row > .attachments-diff-header-tools {
  order: 3;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
}

.attachments-diff-header-tools > .attachments-diff-header-side,
.attachments-diff-header-tools > .attachments-diff-actions-host,
.attachments-diff-header-tools > .attachments-diff-overflow {
  flex: 0 0 auto;
}

.attachments-diff-header-tools > .attachments-diff-header-side {
  order: 1;
}

.attachments-diff-header-tools > .attachments-diff-actions-host {
  order: 2;
}

.attachments-diff-header-tools > .attachments-diff-overflow {
  order: 3;
}

.attachments-diff-modal.attachments-diff-header-wrapped .attachments-diff-title-row {
  flex-wrap: wrap;
  row-gap: 6px;
}

.attachments-diff-modal.attachments-diff-header-wrapped .attachments-diff-title-row h3 {
  flex: 1 1 160px;
  max-width: none;
}

.attachments-diff-modal.attachments-diff-header-wrapped
  .attachments-diff-title-row
  > .attachments-diff-header-tools {
  order: 2;
  margin-left: auto;
}

.attachments-diff-modal.attachments-diff-header-wrapped
  .attachments-diff-title-row
  > .attachments-diff-topbar {
  order: 3;
  flex: 1 0 100%;
  min-width: 0;
  max-width: none;
}

.attachments-diff-modal.attachments-diff-header-wrapped
  .attachments-diff-title-row
  > .attachments-diff-topbar
  .attachments-diff-topbar-content {
  overflow-x: auto;
  scrollbar-width: none;
}

.attachments-diff-modal.attachments-diff-header-wrapped
  .attachments-diff-title-row
  > .attachments-diff-topbar
  .attachments-diff-topbar-content::-webkit-scrollbar {
  display: none;
}

@media (max-width: 1280px) {
  .attachments-diff-title-row {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .attachments-diff-title-row h3 {
    flex: 1 1 160px;
    max-width: none;
  }

  .attachments-diff-title-row > .attachments-diff-header-tools {
    order: 2;
    margin-left: auto;
  }

  .attachments-diff-title-row > .attachments-diff-topbar {
    order: 3;
    flex: 1 0 100%;
    min-width: 0;
    max-width: none;
  }

  .attachments-diff-title-row
    > .attachments-diff-topbar
    .attachments-diff-topbar-content {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .attachments-diff-title-row
    > .attachments-diff-topbar
    .attachments-diff-topbar-content::-webkit-scrollbar {
    display: none;
  }
}

.attachments-diff-version-controls {
  flex: 1 1 auto;
  max-width: min(760px, 58vw);
}

.attachments-diff-version-controls .form-field {
  flex: 1 1 min(260px, 28vw);
}

/* ── Shared loading pane (survives innerHTML clears from pane mount) ── */
.attachments-diff-progress-pane {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  height: 100%;
  overflow: auto;
  align-items: center;
}

.attachments-diff-progress-pane.is-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: min(320px, calc(100% - 24px));
  height: auto;
  max-height: calc(100% - 24px);
  padding: 0;
  overflow: visible;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
}

.attachments-diff-progress-pane.is-overlay .attachments-diff-steps {
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.attachments-diff-progress-pane.is-overlay .attachments-diff-skeleton-label {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.82);
  color: #475569;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.attachments-diff-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  height: 100%;
  overflow: auto;
}

.attachments-diff-skeleton-label {
  margin: 0 var(--space-4);
  font-size: 0.85rem;
  color: #64748b;
}

/* ── Diff progress step indicator ─────────────────────────── */
.attachments-diff-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  min-width: 220px;
  max-width: 280px;
  width: 100%;
  box-sizing: border-box;
}

.attachments-diff-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
  color: #94a3b8;
  transition: color 0.25s ease, opacity 0.25s ease;
  line-height: 1.4;
}

.attachments-diff-step::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: transparent;
  flex-shrink: 0;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.attachments-diff-step.is-active {
  color: #3b82f6;
  font-weight: 500;
}

.attachments-diff-step.is-active::before {
  border-color: #3b82f6;
  background: #3b82f6;
  animation: attachments-diff-step-pulse 1.2s ease-in-out infinite;
}

.attachments-diff-step.is-done {
  color: #22c55e;
}

.attachments-diff-step.is-done::before {
  border-color: #22c55e;
  background: #22c55e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
}

@keyframes attachments-diff-step-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes attachments-diff-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.attachments-diff-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: nowrap;
}

.attachments-diff-actions .ghost-button.is-active {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.2);
}

.attachments-diff-actions .ghost-button {
  white-space: nowrap;
}

.attachments-diff-actions .ghost-button.is-disabled,
.attachments-diff-actions .ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.attachments-diff-settings {
  position: relative;
}

.attachments-diff-actions-host {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

.attachments-diff-overflow {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.attachments-diff-overflow[hidden] {
  display: none !important;
}

.attachments-diff-overflow-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 12;
  min-width: 190px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.attachments-diff-overflow-menu[hidden] {
  display: none !important;
}

.attachments-diff-overflow-menu .attachments-diff-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.attachments-diff-overflow-menu .attachments-diff-actions > .ghost-button,
.attachments-diff-overflow-menu .attachments-diff-settings-trigger {
  width: 100%;
  justify-content: flex-start;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
}

.attachments-diff-overflow-menu .attachments-diff-settings-menu {
  left: auto;
  right: 0;
  top: calc(100% + 6px);
}

.attachments-diff-settings-menu {
  position: absolute;
  left: auto;
  right: 0;
  top: calc(100% + 8px);
  z-index: 8;
  min-width: 280px;
  max-width: min(360px, calc(100vw - 40px));
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(12px);
  transform-origin: top right;
}

.attachments-diff-settings-list {
  display: grid;
  gap: var(--space-2);
}

.attachments-diff-settings-toggle.toggle-switch {
  width: 100%;
  padding: 4px 0;
}

.attachments-diff-settings-toggle.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.attachments-diff-settings-toggle.is-pending {
  opacity: 0.92;
  cursor: progress;
}

.attachments-diff-settings-toggle.is-pending .toggle-switch-track {
  box-shadow: 0 0 0 1px rgba(13, 148, 136, 0.22);
}

.attachments-diff-settings-toggle.is-pending .attachments-diff-settings-label-block small {
  color: #0f766e;
}

.attachments-diff-settings-trigger.is-busy {
  border-color: rgba(13, 148, 136, 0.28);
  background: rgba(240, 253, 250, 0.95);
}

.attachments-diff-settings-label-block {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.attachments-diff-settings-label-block strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.attachments-diff-settings-label-block small {
  display: block;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #64748b;
}

.attachments-diff-settings-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #0f766e;
}

.attachments-diff-settings-status[hidden] {
  display: none;
}

.attachments-diff-settings-status .attachments-inline-spinner {
  color: currentColor;
}

.attachments-diff-settings-highlight {
  display: grid;
  gap: 8px;
  padding: 10px 0 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.attachments-diff-settings-section-title,
.attachments-diff-highlight-popover-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
}

.attachments-diff-highlight-trigger-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.attachments-diff-highlight-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  min-width: 0;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}

.attachments-diff-highlight-trigger-dot {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 999px;
  background: var(--attachments-diff-highlight-trigger-color, #facc15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.46);
}

.attachments-diff-highlight-trigger-label {
  color: #64748b;
  white-space: nowrap;
  opacity: 0.9;
}

.attachments-diff-highlight-trigger.is-active .attachments-diff-highlight-trigger-dot {
  outline: 3px solid rgba(59, 130, 246, 0.62);
  outline-offset: 2px;
}

.attachments-diff-highlight-trigger.is-active .attachments-diff-highlight-trigger-label {
  color: #334155;
}

.attachments-diff-highlight-popover {
  display: grid;
  gap: 6px;
  padding: 10px 0 2px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.attachments-diff-highlight-popover[hidden] {
  display: none !important;
}

.attachments-diff-highlight-popover .attachments-context-section {
  padding: 4px 0;
}

.attachments-diff-highlight-popover .attachments-color-option {
  width: 24px;
  height: 24px;
  border-radius: 9px;
}

.attachments-diff-highlight-popover .attachments-opacity-option {
  width: 44px;
  height: 20px;
}

.attachments-diff-meta {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.attachments-diff-report-dialog {
  width: min(980px, 94vw);
  height: min(88vh, 920px);
}

.attachments-diff-report-body {
  flex: 1;
  overflow: auto;
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  position: relative;
}

.attachments-diff-report-content {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.attachments-diff-report-settings-list {
  display: grid;
  gap: var(--space-2);
}

.attachments-diff-report-settings-field {
  display: grid;
  gap: 6px;
}

.attachments-diff-report-settings-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.attachments-diff-report-settings-select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.82rem;
  color: var(--color-heading);
  background: #fff;
}

.attachments-diff-report-settings-select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.attachments-diff-report-grouping-toggle.toggle-switch {
  width: 100%;
}

.attachments-diff-report-grouping-toggle.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.attachments-diff-report-actions.modal-actions {
  margin-top: var(--space-3);
  gap: var(--space-2);
  padding-top: var(--space-2);
  z-index: 20;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.08);
  background: linear-gradient(
    to top,
    rgba(241, 245, 249, 0.98),
    rgba(241, 245, 249, 0.9),
    rgba(241, 245, 249, 0.82),
    transparent
  );
}

.attachments-diff-report-actions .modal-actions-spacer {
  min-width: 0;
}

.attachments-diff-report-settings {
  position: relative;
}

.attachments-diff-report-settings-trigger.is-disabled,
.attachments-diff-report-settings-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.attachments-diff-report-settings-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  min-width: 248px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.attachments-diff-report-main-table {
  table-layout: fixed;
}

.attachments-diff-report-group-row td {
  background: #e2e8f0 !important;
  border-color: #cbd5e1;
}

.attachments-diff-report-group-header {
  display: grid;
  gap: 3px;
}

.attachments-diff-report-group-title {
  font-weight: 700;
  color: var(--color-heading);
}

.attachments-diff-report-group-summary {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.35;
}

.attachments-diff-report-main-col-location {
  width: 14%;
}

.attachments-diff-report-main-col-change {
  width: 62%;
}

.attachments-diff-report-main-col-note {
  width: 24%;
}

.attachments-diff-report-main-location-cell {
  min-width: 0;
  vertical-align: top;
}

.attachments-diff-report-main-location-compact {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.attachments-diff-report-main-location-short {
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-diff-report-main-location-sub {
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-diff-report-main-location-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex-wrap: wrap;
}

.attachments-diff-report-main-location-kind {
  min-width: 0;
  max-width: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-diff-report-main-location-title {
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.attachments-diff-report-resizable-col {
  position: relative;
  padding-right: 16px !important;
}

.attachments-diff-report-col-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.attachments-diff-report-col-resize-handle::after {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 50%;
  width: 1px;
  background: rgba(100, 116, 139, 0.5);
  transform: translateX(-50%);
}

.attachments-diff-report-resizable-col:hover .attachments-diff-report-col-resize-handle::after {
  background: rgba(37, 99, 235, 0.72);
}

.attachments-diff-report-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.attachments-diff-report-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.attachments-diff-report-save.is-disabled,
.attachments-diff-report-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.attachments-diff-report-save-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3E%3Cpath%20d='M3%202h8l2%202v10H3V2z'%20stroke='%23fff'%20stroke-width='1.2'/%3E%3Cpath%20d='M5%202.8h5v3H5v-3z'%20fill='%23fff'/%3E%3Crect%20x='5'%20y='9'%20width='6'%20height='4'%20rx='0.6'%20stroke='%23fff'%20stroke-width='1.1'/%3E%3C/svg%3E");
}

.attachments-diff-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.attachments-diff-report-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-heading);
}

.attachments-diff-report-meta {
  font-size: 0.85rem;
  color: #64748b;
}

.attachments-diff-report-pair {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 220px;
}

.attachments-diff-report-pair-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: 0.85rem;
}

.attachments-diff-report-pair-label {
  min-width: 64px;
  font-weight: 600;
  color: #64748b;
}

.attachments-diff-report-pair-value {
  font-weight: 600;
  color: var(--color-heading);
}

.attachments-diff-report-pair-meta {
  font-size: 0.8rem;
}

.attachments-diff-report-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.attachments-diff-report-note {
  font-size: 13pt;
  color: #000;
}

.attachments-diff-report-list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding-left: 18px;
}

.attachments-diff-report-item {
  border: 1px solid var(--color-border);
  border-left-width: 4px;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.attachments-diff-report-item.is-add {
  border-left-color: #22c55e;
}

.attachments-diff-report-item.is-remove {
  border-left-color: #ef4444;
}

.attachments-diff-report-item.is-change {
  border-left-color: #3b82f6;
}

.attachments-diff-report-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 600;
}

.attachments-diff-report-status.is-add {
  color: #16a34a;
}

.attachments-diff-report-status.is-remove {
  color: #dc2626;
}

.attachments-diff-report-status.is-change {
  color: #2563eb;
}

.attachments-diff-report-location {
  color: #64748b;
}

.attachments-diff-report-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.attachments-diff-report-column-title {
  font-size: 13pt;
  color: #000;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 4px;
}

.attachments-diff-report-text {
  font-size: 13pt;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.attachments-diff-report-empty-text {
  color: #000;
  font-style: normal;
}

.attachments-diff-report-empty {
  border: 0.8px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  text-align: center;
}

.attachments-diff-report-cover,
.attachments-diff-report-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: transparent;
}

.attachments-diff-report-cover-title {
  font-size: 14pt;
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: #000;
}

.attachments-diff-report-cover-grid,
.attachments-diff-report-doc-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
}

.attachments-diff-report-field-label {
  font-size: 13pt;
  text-transform: none;
  letter-spacing: normal;
  color: #000;
}

.attachments-diff-report-field-value {
  font-size: 13pt;
  font-weight: 600;
}

.attachments-diff-report-section-title {
  font-size: 14pt;
  font-weight: 700;
  color: #000;
  margin-bottom: var(--space-2);
}

.attachments-diff-report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-2);
}

.attachments-diff-report-summary-compact {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  align-items: start;
}

.attachments-diff-report-summary-grid.is-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-1) var(--space-2);
}

.attachments-diff-report-summary-grid.is-compact .attachments-diff-report-summary-item {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.attachments-diff-report-summary-grid.is-compact .attachments-diff-report-summary-label {
  font-size: 13pt;
  letter-spacing: normal;
}

.attachments-diff-report-summary-grid.is-compact .attachments-diff-report-summary-value {
  font-size: 13pt;
}

.attachments-diff-report-summary-timeline {
  border: 1px dashed #e2e8f0;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: transparent;
}

.attachments-diff-report-subtitle.is-compact {
  margin-top: 0;
  font-size: 14pt;
  letter-spacing: normal;
}

.attachments-diff-report-timeline.is-compact {
  gap: 6px;
  font-size: 13pt;
}

.attachments-diff-report-note.is-compact {
  margin-top: var(--space-2);
  font-size: 13pt;
}

.attachments-diff-report-summary-timeline .attachments-diff-report-timeline-row {
  font-size: 13pt;
}

.attachments-diff-report-summary-timeline .attachments-diff-report-timeline-row span:last-child {
  font-weight: 600;
  color: #000;
}

@media (max-width: 960px) {
  .attachments-diff-report-summary-compact {
    grid-template-columns: 1fr;
  }

  .attachments-diff-report-summary-timeline {
    order: 2;
  }
}

.attachments-diff-report-summary-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: transparent;
}

.attachments-diff-report-summary-label {
  font-size: 13pt;
  text-transform: none;
  color: #000;
}

.attachments-diff-report-summary-value {
  margin-top: 4px;
  font-size: 13pt;
  font-weight: 700;
}

.attachments-diff-report-summary-value.is-multiline {
  font-size: 13pt;
  font-weight: 600;
  line-height: 1.35;
}

.attachments-diff-report-summary-value.is-multiline div + div {
  margin-top: 2px;
}

.attachments-diff-report-subtitle {
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
  font-size: 14pt;
  font-weight: 700;
}

.attachments-diff-report-top-list,
.attachments-diff-report-timeline {
  display: grid;
  gap: var(--space-1);
}

.attachments-diff-report-top-doc,
.attachments-diff-report-timeline-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 13pt;
}

.attachments-diff-report-top-name {
  font-weight: 600;
}

.attachments-diff-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13pt;
}

.attachments-diff-report-table th,
.attachments-diff-report-table td {
  border: 1px solid var(--color-border);
  padding: 8px 10px;
  vertical-align: top;
}

.attachments-diff-report-body .attachments-diff-report-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

.attachments-diff-report-table tbody tr:nth-child(odd) td {
  background: rgba(248, 250, 252, 0.72);
}

.attachments-diff-report-table tbody tr:hover td {
  background: rgba(226, 232, 240, 0.42);
}

.attachments-diff-report-type-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.attachments-diff-report-type-meta {
  font-size: 0.74rem;
  line-height: 1.25;
  color: #475569;
  font-weight: 600;
}

.attachments-diff-report-system-meta {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.attachments-diff-report-system-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attachments-diff-report-system-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  border: 1px solid transparent;
}

.attachments-diff-report-system-badge.is-low {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.attachments-diff-report-system-badge.is-medium {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.24);
}

.attachments-diff-report-system-badge.is-high {
  color: #166534;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
}

.attachments-diff-report-system-lines {
  display: grid;
  gap: 2px;
}

.attachments-diff-report-system-line {
  font-size: 0.74rem;
  line-height: 1.4;
  color: #475569;
  white-space: normal;
  overflow-wrap: anywhere;
}

.attachments-diff-report-main-cell-text {
  display: block;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.attachments-diff-report-change-cell {
  min-width: 0;
}

.attachments-diff-report-change-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.attachments-diff-report-change-lane {
  min-width: 0;
  border-left: 3px solid #cbd5e1;
  padding-left: 10px;
}

.attachments-diff-report-change-lane.is-before {
  border-left-color: rgba(239, 68, 68, 0.45);
}

.attachments-diff-report-change-lane.is-after {
  border-left-color: rgba(34, 197, 94, 0.45);
}

.attachments-diff-report-change-lane-label {
  margin-bottom: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  color: #475569;
  text-transform: uppercase;
}

.attachments-diff-report-snippet {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.attachments-diff-report-snippet-context {
  display: inline;
  max-width: none;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  vertical-align: baseline;
}

.attachments-diff-report-snippet-exact {
  display: inline;
  min-width: 0;
  max-width: 100%;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.attachments-diff-report--text-clamp-light .attachments-diff-report-main-cell-text,
.attachments-diff-report--text-clamp-medium .attachments-diff-report-main-cell-text,
.attachments-diff-report--text-clamp-strong .attachments-diff-report-main-cell-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.attachments-diff-report--text-clamp-light .attachments-diff-report-main-cell-text {
  -webkit-line-clamp: 8;
  max-height: calc(1.45em * 8);
}

.attachments-diff-report--text-clamp-medium .attachments-diff-report-main-cell-text {
  -webkit-line-clamp: 5;
  max-height: calc(1.45em * 5);
}

.attachments-diff-report--text-clamp-strong .attachments-diff-report-main-cell-text {
  -webkit-line-clamp: 3;
  max-height: calc(1.45em * 3);
}

.attachments-diff-report-row.is-change td {
  background: transparent;
}

.attachments-diff-report-change-mark {
  background: rgba(59, 130, 246, 0.18);
  border-radius: 3px;
  padding: 0 2px;
}

.attachments-diff-report-removed {
  background: transparent;
  text-decoration: line-through;
}

.attachments-diff-report-table-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.attachments-diff-report-table-detail {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
}

.attachments-diff-report-table-detail .attachments-diff-report-table {
  table-layout: fixed;
}

.attachments-diff-report-col-position {
  width: 14%;
}

.attachments-diff-report-col-change {
  width: auto;
}

.attachments-diff-report-col-note {
  width: 24%;
}

.attachments-diff-report-table-detail .attachments-diff-report-table th:nth-child(1),
.attachments-diff-report-table-detail .attachments-diff-report-table td:nth-child(1) {
  white-space: normal;
}

.attachments-diff-report-table-detail .attachments-diff-report-table td:nth-child(2) {
  word-break: break-word;
}

.attachments-diff-report-note-cell {
  width: 180px;
}

.attachments-diff-report-note-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachments-diff-report-note-input {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 13pt;
  line-height: 1.4;
  background: #fff;
  color: #000;
}

.attachments-diff-report-note-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.attachments-diff-report-note-text {
  display: none;
  font-size: 13pt;
  line-height: 1.35;
  color: #000;
  white-space: pre-wrap;
  word-break: break-word;
}

.attachments-diff-report-note-field.is-readonly .attachments-diff-report-note-text {
  display: block;
  min-height: 44px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #fff;
  color: #475569;
}

.attachments-diff-report-table-name {
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.attachments-diff-report-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: transparent;
  color: #000;
}

.attachments-diff-report-badge.is-add {
  background: transparent;
  color: #19ae8b;
}

.attachments-diff-report-badge.is-remove {
  background: transparent;
  color: #bd3535;
}

.attachments-diff-report-badge.is-change {
  color: #1d4ed8;
}

.attachments-diff-report-summary-line {
  font-size: 13pt;
  color: #000;
}

@media (max-width: 720px) {
  .attachments-diff-report-columns {
    grid-template-columns: 1fr;
  }
}

.attachments-diff-stats-summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.attachments-diff-topbar .attachments-diff-stats-summary {
  flex-wrap: nowrap;
}

.attachments-diff-stats-summary[hidden] {
  display: none !important;
}

.attachments-diff-stats-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.attachments-diff-nav-counter {
  min-width: 42px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.attachments-diff-nav-button {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition-base), color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
}

.attachments-diff-nav-button:hover,
.attachments-diff-nav-button:focus-visible {
  border-color: rgba(59, 130, 246, 0.6);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.attachments-diff-nav-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.attachments-diff-stats-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--color-border);
  background: #fff;
}

.attachments-diff-stats-chip.is-add {
  color: rgba(21, 128, 61, 0.95);
}

.attachments-diff-stats-chip.is-remove {
  color: rgba(185, 28, 28, 0.95);
}

.attachments-diff-stats-chip.is-change {
  color: rgba(180, 83, 9, 0.95);
}

.attachments-diff-content {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius-lg) + 8px);
  background: #f8fafc;
  overflow: auto;
  max-height: 100vh;
}

.attachments-diff-workspace {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  gap: var(--space-2);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.attachments-diff-workspace .attachments-diff-content {
  min-width: 0;
}

.attachments-diff-explanation-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  position: relative;
  z-index: 2;
  flex: 0 0 var(--attachments-diff-explanation-width, min(340px, 30vw));
  width: var(--attachments-diff-explanation-width, min(340px, 30vw));
  min-width: 280px;
  max-width: min(420px, 38vw);
  min-height: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: calc(var(--radius-lg) + 8px);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.95));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.attachments-diff-explanation-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 2;
  width: 14px;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.attachments-diff-explanation-resize-handle[hidden] {
  display: none !important;
}

.attachments-diff-explanation-resize-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 4px;
  height: 52px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.18), rgba(100, 116, 139, 0.52));
  box-shadow: inset 0 0 0 1px rgba(71, 85, 105, 0.12);
  opacity: 0.55;
  transition:
    opacity var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.attachments-diff-explanation-resize-handle:hover::before,
.attachments-diff-explanation-resize-handle:focus-visible::before,
.attachments-diff-modal--explanation-resizing
  .attachments-diff-explanation-resize-handle::before {
  opacity: 1;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.68));
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.attachments-diff-explanation-resize-handle:focus-visible {
  outline: none;
}

.attachments-diff-modal--explanation-resizing,
.attachments-diff-modal--explanation-resizing * {
  cursor: col-resize !important;
  user-select: none;
  -webkit-user-select: none;
}

.attachments-diff-explanation-panel[hidden] {
  display: none !important;
}

.attachments-diff-explanation-panel-header {
  display: flex;
  position: relative;
  z-index: 3;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-bottom: 8px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(248, 250, 252, 0.9));
}

.attachments-diff-explanation-title {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
}

.attachments-diff-explanation-subtitle {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: 2px;
}

.attachments-diff-explanation-subtitle.is-error {
  color: #b91c1c;
}

.attachments-diff-explanation-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.attachments-diff-explanation-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.attachments-diff-explanation-filter-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.attachments-diff-explanation-filter-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.attachments-diff-explanation-filter-options--status {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attachments-diff-explanation-filter {
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  color: #475569;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
  padding: 5px 7px;
}

.attachments-diff-explanation-filter:hover,
.attachments-diff-explanation-filter:focus-visible,
.attachments-diff-explanation-filter.is-active {
  border-color: rgba(37, 99, 235, 0.42);
  background: #fff;
  color: #1d4ed8;
  outline: none;
}

.attachments-diff-explanation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.attachments-diff-explanation-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 12px;
}

.attachments-diff-explanation-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  padding: 7px;
}

.attachments-diff-explanation-item.is-active {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.attachments-diff-explanation-item-focus {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.attachments-diff-explanation-item-focus:focus-visible {
  border-radius: var(--radius-sm);
  outline: 2px solid rgba(37, 99, 235, 0.42);
  outline-offset: 2px;
}

.attachments-diff-explanation-item-main {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
}

.attachments-diff-explanation-item-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.9);
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
}

.attachments-diff-explanation-item-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.attachments-diff-explanation-item-snippet {
  color: #0f172a;
  display: -webkit-box;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.36;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.attachments-diff-explanation-item-badges {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: flex-end;
  max-width: 128px;
  min-width: 0;
}

.attachments-diff-explanation-status,
.attachments-diff-explanation-note-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  padding: 2px 7px;
}

.attachments-diff-explanation-status {
  order: 2;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  min-height: 0;
  padding: 0;
}

.attachments-diff-explanation-note-status {
  order: 1;
  min-width: 0;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-diff-explanation-status.is-add {
  color: #15803d;
  background: #22c55e;
}

.attachments-diff-explanation-status.is-remove {
  color: #b91c1c;
  background: #f43f5e;
}

.attachments-diff-explanation-status.is-change {
  color: #92400e;
  background: #f59e0b;
}

.attachments-diff-explanation-note-status.is-has-note {
  color: #0f766e;
}

.attachments-diff-explanation-note-status.is-missing {
  color: #475569;
}

.attachments-diff-explanation-note-status.is-unresolved {
  color: #c2410c;
}

.attachments-diff-explanation-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 750;
  margin-top: 1px;
}

.attachments-diff-explanation-note textarea {
  min-height: 74px;
  resize: vertical;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: var(--radius-md);
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px;
}

.attachments-diff-explanation-note textarea:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.attachments-diff-explanation-note textarea:disabled {
  background: rgba(241, 245, 249, 0.85);
  color: #64748b;
  cursor: not-allowed;
}

.attachments-diff-explanation-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.attachments-diff-explanation-note-readonly,
.attachments-diff-explanation-unresolved,
.attachments-diff-explanation-item-hint {
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.35;
}

.attachments-diff-explanation-note-readonly,
.attachments-diff-explanation-unresolved {
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 252, 0.86);
  padding: 6px 8px;
}

.attachments-diff-explanation-note-readonly {
  color: #334155;
  max-height: 88px;
  overflow: auto;
  white-space: pre-wrap;
}

.attachments-diff-explanation-note-readonly.is-empty {
  color: #64748b;
}

.attachments-diff-explanation-save {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 10px;
  font-size: 0.75rem;
}

.attachments-diff-explanation-save[hidden] {
  display: none;
}

.attachments-diff-preview {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  min-height: 100%;
  height: 100%;
  align-items: stretch;
}

.attachments-diff-preview--dual-scroll-gutter::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: max(8px, var(--space-3));
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, background 0.14s ease;
  z-index: 4;
}

.attachments-diff-preview--dual-scroll-gutter.is-gutter-hover::before {
  opacity: 1;
  background: rgba(15, 118, 110, 0.16);
}

.attachments-diff-preview .attachments-docx-preview {
  flex: 0 0 auto;
  height: auto;
  min-height: 100%;
  max-height: none;
  overflow: visible;
}

.attachments-diff-mirror-spacer {
  margin: 0;
  opacity: 0.38;
  pointer-events: none;
  user-select: none;
  border-radius: 4px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  background: rgba(226, 232, 240, 0.34);
}

.attachments-diff-mirror-spacer[data-diff-status="add"] {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.16);
}

.attachments-diff-mirror-spacer[data-diff-status="remove"] {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.13);
}

.attachments-diff-mirror-spacer-row {
  display: table-row;
  height: var(--diff-spacer-row-height, 24px);
  min-height: var(--diff-spacer-row-height, 24px);
}

.attachments-diff-mirror-spacer-row > td {
  border-style: dashed;
  border-width: 1px;
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(226, 232, 240, 0.34);
  pointer-events: none;
  user-select: none;
  height: inherit;
  min-height: inherit;
  box-sizing: border-box;
}

.attachments-diff-mirror-spacer-row[data-diff-status="add"] > td {
  border-color: var(--attachments-diff-add-border, rgba(22, 163, 74, 0.12));
  background: var(--attachments-diff-add-bg, rgba(34, 197, 94, 0.075));
}

.attachments-diff-mirror-spacer-row[data-diff-status="remove"] > td {
  border-color: var(--attachments-diff-remove-border, rgba(220, 38, 38, 0.12));
  background: var(--attachments-diff-remove-bg, rgba(239, 68, 68, 0.075));
}

.attachments-diff-block-added {
  --attachments-diff-border: var(--attachments-diff-add-border, rgba(22, 163, 74, 0.12));
  background: var(--attachments-diff-add-bg, rgba(34, 197, 94, 0.075));
  box-shadow: inset 0 0 0 1px var(--attachments-diff-border);
  border-radius: 8px;
}

.attachments-diff-block-removed {
  --attachments-diff-border: var(--attachments-diff-remove-border, rgba(220, 38, 38, 0.12));
  background: var(--attachments-diff-remove-bg, rgba(239, 68, 68, 0.075));
  box-shadow: inset 0 0 0 1px var(--attachments-diff-border);
  border-radius: 8px;
}

.attachments-diff-block-changed {
  --attachments-diff-border: var(--attachments-diff-change-border, rgba(217, 119, 6, 0.12));
  background: var(--attachments-diff-change-bg, rgba(251, 191, 36, 0.075));
  box-shadow: inset 0 0 0 1px var(--attachments-diff-border);
  border-radius: 8px;
}

.attachments-diff-note-marker-target {
  position: relative;
  overflow: visible;
}

.attachments-diff-note-marker-target::after {
  content: none;
}

.attachments-diff-note-marker-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(38%, -42%);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 1.55rem;
  min-width: 1.55rem;
  max-width: 1.55rem;
  inline-size: 1.55rem;
  min-inline-size: 1.55rem;
  max-inline-size: 1.55rem;
  height: 1.15rem;
  min-height: 1.15rem;
  max-height: 1.15rem;
  padding: 0;
  border-radius: 999px;
  background: #0f766eb8;
  color: #f8fafc !important;
  border: 1px solid rgba(15, 118, 110, 0.3);
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.24);
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 10px !important;
  font-style: normal !important;
  font-weight: 800 !important;
  font-variant: normal !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-align-last: center !important;
  text-decoration: none !important;
  text-indent: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  direction: ltr !important;
  overflow: hidden;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
  user-select: none;
  z-index: 3;
  -webkit-text-fill-color: #f8fafc !important;
  mix-blend-mode: normal;
  isolation: isolate;
}

.attachments-diff-note-marker-badge-text {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  color: #f8fafc !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 10px !important;
  font-style: normal !important;
  font-weight: 800 !important;
  font-variant: normal !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-align-last: center !important;
  text-decoration: none !important;
  text-indent: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  direction: ltr !important;
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-text-fill-color: #f8fafc !important;
}

.attachments-diff-preview table.attachments-diff-block-added tr.attachments-diff-block-added,
.attachments-diff-preview table.attachments-diff-block-removed tr.attachments-diff-block-removed {
  background: transparent;
  box-shadow: none;
}

.attachments-diff-preview tr[data-diff-cell-detail-row="true"].attachments-diff-block-changed {
  background: var(--attachments-diff-row-change-bg, rgba(251, 191, 36, 0.035));
  box-shadow: inset 0 0 0 1px var(--attachments-diff-row-change-border, rgba(217, 119, 6, 0.075));
}

.attachments-diff-preview tr[data-diff-cell-detail-row="true"].attachments-diff-block-changed > td:not([data-diff-key]),
.attachments-diff-preview tr[data-diff-cell-detail-row="true"].attachments-diff-block-changed > th:not([data-diff-key]) {
  background: var(--attachments-diff-row-change-plain-cell-bg, rgba(251, 191, 36, 0.02));
  cursor: default;
}

.attachments-diff-preview td[data-diff-key][data-diff-status],
.attachments-diff-preview th[data-diff-key][data-diff-status] {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--attachments-diff-border);
  outline-offset: -2px;
  cursor: pointer;
}

.attachments-diff-preview td[data-diff-key][data-diff-status="add"],
.attachments-diff-preview th[data-diff-key][data-diff-status="add"] {
}

.attachments-diff-preview td[data-diff-key][data-diff-status="remove"],
.attachments-diff-preview th[data-diff-key][data-diff-status="remove"] {
  --attachments-diff-border: var(--attachments-diff-remove-cell-border, rgba(220, 38, 38, 0.135));
  background-color: var(--attachments-diff-remove-cell-bg, rgba(239, 68, 68, 0.1)) !important;
}

.attachments-diff-preview td[data-diff-key][data-diff-status="change"],
.attachments-diff-preview th[data-diff-key][data-diff-status="change"] {
  --attachments-diff-border: var(--attachments-diff-change-cell-border, rgba(217, 119, 6, 0.135));
  background-color: var(--attachments-diff-change-cell-bg, rgba(251, 191, 36, 0.1)) !important;
}

.attachments-diff-preview p[data-diff-key][data-diff-status].attachments-diff-run-start {
  margin-bottom: 0 !important;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow:
    inset 1px 0 0 var(--attachments-diff-border),
    inset -1px 0 0 var(--attachments-diff-border),
    inset 0 1px 0 var(--attachments-diff-border);
}

.attachments-diff-preview p[data-diff-key][data-diff-status].attachments-diff-run-mid {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-radius: 0;
  box-shadow:
    inset 1px 0 0 var(--attachments-diff-border),
    inset -1px 0 0 var(--attachments-diff-border),
    inset 0 -1px 0 var(--attachments-diff-border);
}

.attachments-diff-preview p[data-diff-key][data-diff-status].attachments-diff-run-end {
  margin-top: 0 !important;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow:
    inset 1px 0 0 var(--attachments-diff-border),
    inset -1px 0 0 var(--attachments-diff-border),
    inset 0 -1px 0 var(--attachments-diff-border);
}

.attachments-diff-mirror-spacer[data-diff-status] + .attachments-diff-mirror-spacer[data-diff-status] {
  margin-top: 0 !important;
}

.attachments-diff-mirror-spacer[data-diff-status="add"] + .attachments-diff-mirror-spacer[data-diff-status="add"] {
  border-top-color: transparent;
}

.attachments-diff-mirror-spacer[data-diff-status="remove"] + .attachments-diff-mirror-spacer[data-diff-status="remove"] {
  border-top-color: transparent;
}

.attachments-diff-preview [data-diff-key] {
  cursor: pointer;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.attachments-diff-preview [data-diff-key]:hover {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.2);
}

.attachments-diff-preview [data-diff-key].is-selected {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.35);
}

.attachments-diff-preview .attachments-diff-fragment-range {
  display: inline;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  vertical-align: baseline;
}

.attachments-diff-preview span.attachments-diff-added,
.attachments-diff-preview span.attachments-diff-removed,
.attachments-diff-preview span.attachments-diff-changed,
.attachments-diff-preview span.attachments-diff-explanation-doc-focus {
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  vertical-align: baseline;
}

.attachments-diff-preview .attachments-diff-explanation-doc-focus,
.attachments-diff-preview [data-diff-key].attachments-diff-explanation-doc-focus,
.attachments-diff-preview [data-diff-anchor-key].attachments-diff-explanation-doc-focus,
.attachments-diff-preview [data-diff-owner-key].attachments-diff-explanation-doc-focus {

}

.attachments-diff-preview td.attachments-diff-explanation-doc-focus,
.attachments-diff-preview th.attachments-diff-explanation-doc-focus {
  box-shadow:
    inset 0 0 0 2px rgba(37, 99, 235, 0.62),
    0 0 0 3px rgba(37, 99, 235, 0.22);
}

.attachments-diff-preview span.attachments-diff-explanation-doc-focus {
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.14);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.attachments-diff-preview [data-diff-key].attachments-diff-ignored {
  opacity: 0.5;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.65);
  filter: saturate(0.55);
}

.attachments-diff-preview [data-diff-key].attachments-diff-ignored:hover {
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.85);
}

.attachments-diff-context-menu {
  min-width: 230px;
}

.attachments-diff-markers {
  position: absolute;
  top: 0;
  right: 4px;
  width: 8px;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

.attachments-diff-marker {
  position: absolute;
  left: 0;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0.9;
  z-index: 1;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.12s ease;
}

.attachments-diff-marker.is-add {
  background: rgba(34, 197, 94, 0.85);
}

.attachments-diff-marker.is-remove {
  background: rgba(239, 68, 68, 0.85);
}

.attachments-diff-marker.is-change {
  background: rgba(251, 191, 36, 0.9);
}

.attachments-diff-marker.is-current,
.attachments-diff-marker[aria-current="true"] {
  opacity: 1;
  transform: scale(1.3);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.96),
    0 0 0 4px rgba(15, 23, 42, 0.28);
}

.attachments-diff-popover {
  position: absolute;
  z-index: 8;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.12),
    0 4px 10px rgba(15, 23, 42, 0.06);
  padding: 8px;
  overflow: auto;
}

.attachments-diff-popover-resize {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 16px;
  height: 16px;
  cursor: se-resize;
  opacity: 0.6;
  border-radius: 4px;
  background: linear-gradient(
    135deg,
    transparent 0 35%,
    rgba(148, 163, 184, 0.8) 35% 40%,
    transparent 40% 60%,
    rgba(148, 163, 184, 0.8) 60% 65%,
    transparent 65% 100%
  );
  touch-action: none;
}

.attachments-diff-popover-resize:hover,
.attachments-diff-popover-resize:focus-visible {
  opacity: 0.9;
}

.attachments-diff-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 10px;
}

.attachments-diff-popover-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.attachments-diff-popover-hint {
  max-width: 220px;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.35;
}

.attachments-diff-popover-header .ghost-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
}

.attachments-diff-detail {
  margin-top: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: var(--space-3);
}

.attachments-diff-detail-header {
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
}

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

.attachments-diff-detail-column {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.attachments-diff-detail-column--base {
  border-top: 0.5px solid rgba(239, 68, 68, 0.32);
}

.attachments-diff-detail-column--target {
  border-top: 0.5px solid rgba(34, 197, 94, 0.32);
}

.attachments-diff-detail-column-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px 8px;
}

.attachments-diff-detail-content {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  padding: 0 12px 12px;
  background: transparent;
  overflow: auto;
  color: #111827;
  font-family: "Times New Roman", "Times New Roman PS", "Times", "Tinos", "Liberation Serif", "Noto Serif", serif;
  font-size: 13pt;
  line-height: 1.55;
}

.attachments-diff-detail-content .attachments-diff-added,
.attachments-diff-detail-content .attachments-diff-removed {
  padding: 0 2px;
  color: inherit;
  background: rgba(78, 228, 40, 0.16);
  font-weight: inherit;
  outline: 1px solid rgba(17, 24, 39, 0.18);
}

.attachments-diff-detail-content .attachments-diff-added {
  text-decoration-thickness: 0.25px;
  text-underline-offset: 2px;
}

.attachments-diff-detail-content .attachments-diff-removed {
  text-decoration: line-through;
}

.attachments-diff-detail-content p {
  margin: 4px 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.attachments-diff-detail-content .attachments-diff-table {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.attachments-diff-detail-content .attachments-diff-table td,
.attachments-diff-detail-content .attachments-diff-table th {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.attachments-diff-detail-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), #fff);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachments-diff-detail-note-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.attachments-diff-detail-note-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachments-diff-detail-note-title {
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.attachments-diff-detail-note-status {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}

.attachments-diff-detail-note[data-note-mode="invalidated"] .attachments-diff-detail-note-status {
  color: #b91c1c;
}

.attachments-diff-detail-note[data-note-mode="resolved"] .attachments-diff-detail-note-status {
  color: #0f766e;
}

.attachments-diff-detail-note-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.attachments-diff-detail-note-save {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #0f766e;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.attachments-diff-detail-note-save:hover:not(:disabled) {
  background: #115e59;
}

.attachments-diff-detail-note-save:disabled,
.attachments-diff-detail-note-save.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.attachments-diff-detail-note-input {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  line-height: 1.5;
}

.attachments-diff-detail-note-input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: rgba(15, 118, 110, 0.42);
}

.attachments-diff-detail-note-input:disabled,
.attachments-diff-detail-note-input[readonly] {
  background: #f8fafc;
  color: #475569;
}

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

.attachments-diff-view.attachments-diff-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachments-diff-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.attachments-diff-cell {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  overflow: auto;
}

.attachments-diff-placeholder {
  background: #f8fafc;
  border-style: dashed;
}

.attachments-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.attachments-diff-table td,
.attachments-diff-table th {
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 6px 8px;
  vertical-align: top;
  white-space: pre-wrap;
}

.attachments-diff-table th {
  background: #f8fafc;
  font-weight: 600;
}

.attachments-diff-column {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
  max-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.attachments-diff-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.attachments-diff-column.is-base {
  border-top: 2px solid rgba(239, 68, 68, 0.25);
}

.attachments-diff-column.is-target {
  border-top: 2px solid rgba(34, 197, 94, 0.25);
}

.attachments-diff-modal.attachments-diff-modal--semantic-first .attachments-diff-preview {
  grid-template-columns: minmax(0, 1fr);
}

.attachments-diff-modal.attachments-diff-modal--semantic-first .attachments-diff-detail-columns {
  grid-template-columns: minmax(0, 1fr);
}

.attachments-diff-modal.attachments-diff-modal--semantic-first .attachments-diff-view {
  grid-template-columns: minmax(0, 1fr);
}

.attachments-diff-modal.attachments-diff-modal--semantic-first .attachments-diff-view.attachments-diff-rows .attachments-diff-row {
  grid-template-columns: minmax(0, 1fr);
}

.attachments-diff-modal.attachments-diff-modal--semantic-first .attachments-diff-column.is-base {
  display: none;
}

.attachments-diff-modal.attachments-diff-modal--semantic-first .attachments-diff-column.is-target {
  border-top: none;
}

.attachments-diff-title {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.attachments-diff-detail-column--base .attachments-diff-title {
  color: #991b1b;
}

.attachments-diff-detail-column--target .attachments-diff-title {
  color: #166534;
}

.attachments-diff-added {
  background: rgba(34, 197, 94, 0.2);
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.attachments-diff-removed {
  background: rgba(239, 68, 68, 0.18);
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  text-decoration: line-through;
}

.attachments-diff-changed {
  background: rgba(251, 191, 36, 0.2);
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

@media (max-width: 900px) {
  .attachments-preview-dialog,
  .attachments-diff-modal.attachments-diff-modal--desktop .attachments-diff-dialog {
    width: min(92vw, 900px);
  }

  .attachments-diff-modal.attachments-diff-modal--desktop .attachments-diff-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachments-diff-modal.attachments-diff-modal--desktop .attachments-diff-detail-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachments-diff-detail-note-header {
    flex-direction: column;
    align-items: stretch;
  }

  .attachments-diff-detail-note-actions {
    justify-content: flex-start;
  }

  .attachments-diff-modal.attachments-diff-modal--desktop .attachments-diff-view {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachments-diff-modal.attachments-diff-modal--desktop .attachments-diff-view.attachments-diff-rows .attachments-diff-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachments-diff-modal.attachments-diff-modal--desktop .attachments-diff-column {
    max-height: none;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-dialog {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-dialog.modal-dialog.attachments-preview-dialog--compact {
    border: none;
    background: #fff;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-dialog .modal-body {
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 0;
    border: none;
    background: #fff;
    overflow: hidden;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-preview-body {
    height: 100%;
    min-height: 0;
    gap: 0;
    padding: 0;
    border: none;
    background: #fff;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-dialog .modal-header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 5;
    padding: var(--space-3);
    padding-bottom: var(--space-2);
    background: #f8fafc;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-dialog .modal-header::after {
    display: none;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-header-actions {
    display: none;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-back-button {
    display: inline-flex;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-back-button {
    width: 30px;
    height: 30px;
    font-size: 0.92rem;
    border-radius: 9px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-topbar {
    padding: 0;
    border: none;
    border-radius: 0;
    background: #fff;
    align-items: stretch;
    gap: var(--space-2);
    box-shadow: none;
    margin-top: 0 !important;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-topbar {
    margin-bottom: 0;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-topbar .attachments-diff-topbar-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile
    .attachments-diff-topbar
    .attachments-diff-topbar-content::-webkit-scrollbar {
    display: none;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-topbar .attachments-diff-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: var(--space-2);
    width: 100%;
    min-width: 0;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-topbar {
    overflow: visible;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-topbar .attachments-diff-meta-row {
    width: auto;
    margin-left: 0;
    padding-top: 0;
    border-top: none;
    gap: var(--space-1);
    justify-content: space-between;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-controls {
    margin-right: 0;
    width: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-title-row {
    gap: 8px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-header h3 {
    font-size: 1rem;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-version-controls {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-controls .form-field {
    min-width: 0;
    flex: none;
    width: 100%;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-controls .form-field select {
    min-width: 0;
    width: 100%;
    height: 32px;
    font-size: 0.78rem;
    padding: 4px 8px 4px 28px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-controls .attachments-diff-field--base select,
  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-controls .attachments-diff-field--target select {
    background-position: 10px 50%;
    background-size: 8px 8px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-actions {
    width: auto;
    justify-content: flex-start;
    flex: 0 0 auto;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-actions .ghost-button {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.78rem;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-settings-menu {
    left: auto;
    right: 0;
    min-width: min(280px, calc(100vw - 32px));
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-topbar .attachments-diff-meta {
    margin-left: 0;
    width: auto;
    min-width: 0;
    padding-top: 0;
    border-top: none;
    justify-content: flex-start;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-stats-nav {
    gap: 6px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-nav-button {
    width: 30px;
    height: 30px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-nav-counter {
    min-width: 48px;
    font-size: 0.76rem;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-stats-summary {
    width: auto;
    gap: 6px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-stats-chip {
    font-size: 0.72rem;
    padding: 2px 7px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-content {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-workspace {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-explanation-panel {
    position: absolute;
    top: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 7;
    width: min(88vw, 360px);
    min-width: min(88vw, 360px);
    max-width: min(88vw, 360px);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-explanation-resize-handle {
    display: none !important;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-progress-pane.is-overlay {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100% - 24px);
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-preview {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    height: 100%;
    min-height: 0;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-detail-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-view {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-view.attachments-diff-rows .attachments-diff-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-column {
    height: 100%;
    max-height: none;
    min-height: 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-column.is-base {
    display: none;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-column.is-target {
    border-top: none;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-scroll {
    height: 100%;
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: auto;
    padding: 0 2px 88px;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-column.is-target .attachments-diff-mirror-spacer[data-diff-status="remove"] {
    opacity: 1;
    pointer-events: auto;
    border-style: solid;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 22px;
    padding: 0 10px;
    width: fit-content;
    max-width: 100%;
    margin: 4px 0;
    font-size: 0;
    color: rgba(185, 28, 28, 0.95);
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.38);
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-column.is-target .attachments-diff-mirror-spacer[data-diff-status="remove"]::before {
    content: "[...]";
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-preview-side.is-floating {
    bottom: max(8px, env(safe-area-inset-bottom));
    max-width: calc(100% - 16px);
    opacity: 0.92;
    padding: 4px 6px;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-preview-side.is-floating .attachments-search-input {
    width: min(132px, 32vw);
    padding: 3px 8px;
    font-size: 0.78rem;
  }

  .attachments-diff-modal.attachments-diff-modal--mobile .attachments-preview-side.is-floating .ghost-button {
    min-width: 34px;
    min-height: 30px;
    padding: 4px 6px;
    font-size: 0.78rem;
  }
}

.attachments-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.attachments-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex: 1 1 auto;
  min-height: 0;
}

.attachments-modal-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1 1 auto;
  min-height: 0;
}

.attachments-modal-block {
  padding: var(--space-3);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  flex: 1 1 auto;
  min-height: 0;
}

.attachments-modal-block h4 {
  margin: 0 0 var(--space-2);
  font-size: 0.95rem;
}

.attachments-staging {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.attachments-staging-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
}

.attachments-staging-row .form-field {
  min-width: 200px;
  flex: 1;
}

.attachments-staging-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.attachments-staging-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.attachments-staging-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}

.attachments-staging-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.attachments-staging-status {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.attachments-file-browser-dialog {
  max-width: min(96vw, 1200px);
  overflow: hidden;
}

.attachments-file-browser-dialog .modal-header {
  z-index: 6;
}

.attachments-file-browser-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.attachments-file-browser {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 0;
  height: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 0;
}

.attachments-file-browser.has-preview {
  grid-template-columns: 240px minmax(0, 1fr) 320px;
}

.attachments-file-sidebar {
  padding: var(--space-4);
  background: var(--color-surface-subtle);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: auto;
  min-height: 0;
}

.attachments-file-sidebar .filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.attachments-file-sidebar input,
.attachments-file-sidebar select {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.9rem;
}

.attachments-file-date-range {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

.attachments-file-date-range input {
  min-width: 0;
  width: 100%;
}

.attachments-file-date-range span {
  text-align: center;
  color: var(--color-text-muted);
}

.attachments-file-toggle label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
}

.attachments-file-main {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  min-height: 0;
}

.attachments-file-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--color-surface);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.attachments-file-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: nowrap;
}

.attachments-file-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.attachments-file-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.attachments-file-toolbar-filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.attachments-file-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
}

.attachments-file-nav .ghost-icon-button {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
}

.attachments-file-path {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  padding: 6px 12px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  min-width: 160px;
  max-width: 420px;
  flex: 1 1 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-file-segment {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--color-surface);
}

.attachments-file-segment button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.attachments-file-segment button.is-active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

.attachments-file-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.attachments-file-view-toggle button {
  width: 30px;
  height: 30px;
  font-size: 0.9rem;
  padding: 0;
}

.attachments-file-search input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 0.85rem;
  min-width: 180px;
  background: var(--color-surface);
}

.attachments-file-toolbar select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 0.85rem;
  background: var(--color-surface);
}

.attachments-file-banner {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
  font-size: 0.85rem;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.attachments-file-table {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.attachments-file-browser-table th,
.attachments-file-browser-table td {
  padding: 10px 12px;
  font-size: 0.85rem;
}

.attachments-file-browser-table thead th {
  background: var(--color-surface-subtle);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.attachments-file-row {
  transition: background var(--transition-base);
}

.attachments-file-row:hover {
  background: rgba(15, 23, 42, 0.04);
}

.attachments-file-row-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.attachments-file-row:hover .attachments-file-row-actions {
  opacity: 1;
  pointer-events: auto;
}

.attachments-file-row-actions button {
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  font-size: 0.75rem;
  cursor: pointer;
}

.attachments-file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 720px;
}

.attachments-file-list-header {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 120px 70px 160px 150px 140px;
  gap: var(--space-2);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 8px var(--space-3);
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.attachments-file-list--grid .attachments-file-list-header {
  display: none;
}

.attachments-file-folder {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.attachments-file-folder-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: none;
  background: var(--color-surface-subtle);
  cursor: pointer;
  text-align: left;
}

.attachments-file-folder-toggle:hover {
  background: rgba(148, 163, 184, 0.18);
}

.attachments-file-folder-icon {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.attachments-file-folder-name {
  font-weight: var(--font-weight-medium);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-file-folder-meta {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.attachments-file-folder-content {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.attachments-file-document-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface);
  margin-left: var(--space-2);
}

.attachments-file-document-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-1);
  font-size: 0.85rem;
  border-bottom: 1px dashed var(--color-border);
}

.attachments-file-document-name {
  font-weight: var(--font-weight-medium);
}

.attachments-file-document-meta {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.attachments-file-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: var(--space-2);
}

.attachments-file-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 120px 70px 160px 150px 140px;
  gap: var(--space-2);
  padding: 8px var(--space-2);
  border-radius: var(--radius-md);
}

.attachments-file-row.is-selected {
  background: rgba(59, 130, 246, 0.12);
}

.attachments-file-row:nth-child(even) {
  background: rgba(148, 163, 184, 0.08);
}

.attachments-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
  padding: var(--space-2);
}

.attachments-file-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  cursor: pointer;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.attachments-file-card.is-selected {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.15);
}

.attachments-file-card-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 0.85rem;
}

.attachments-file-card-title {
  font-weight: var(--font-weight-medium);
}

.attachments-file-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.attachments-file-card-actions {
  display: flex;
  gap: 6px;
}

.attachments-file-card-actions button {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  background: var(--color-surface);
  font-size: 0.75rem;
  cursor: pointer;
}

.attachments-file-name-text {
  font-weight: var(--font-weight-medium);
}

.attachments-file-name-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachments-file-subtle {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.attachments-file-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.attachments-file-badge--ready {
  color: #047857;
}

.attachments-file-badge--draft {
  color: #0369a1;
}

.attachments-file-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.attachments-file-preview {
  border-left: 1px solid var(--color-border);
  padding: var(--space-4);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.attachments-file-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.attachments-file-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.attachments-file-preview-line {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.attachments-file-empty,
.attachments-file-loading {
  padding: var(--space-4);
  text-align: center;
}
.submit-attachments-dropzone {
  min-height: 140px;
}

.submit-attachments-table-container {
  display: block;
  max-height: 320px;
}

.submit-attachments-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.submit-inline-attachments-list.table-container.scrollable .submit-attachments-table,
.submit-attachments-table-container.table-container.scrollable .submit-attachments-table {
  min-width: 760px;
}

.submit-attachments-table th,
.submit-attachments-table td {
  padding: var(--space-2) var(--space-3);
}

.submit-attachments-table th:nth-child(1),
.submit-attachments-table td:nth-child(1) {
  width: 36%;
}

.submit-attachments-table th:nth-child(2),
.submit-attachments-table td:nth-child(2) {
  width: 24%;
}

.submit-attachments-table th:nth-child(3),
.submit-attachments-table td:nth-child(3) {
  width: 12%;
}

.submit-attachments-table th:nth-child(4),
.submit-attachments-table td:nth-child(4) {
  width: 18%;
}

.submit-attachments-table th:nth-child(5),
.submit-attachments-table td:nth-child(5) {
  width: 10%;
}

.attachments-upload-table th:nth-child(1),
.attachments-upload-table td:nth-child(1) {
  width: 40%;
}

.attachments-upload-table th:nth-child(2),
.attachments-upload-table td:nth-child(2) {
  width: 22%;
}

.attachments-upload-table th:nth-child(3),
.attachments-upload-table td:nth-child(3) {
  width: 14%;
}

.attachments-upload-table th:nth-child(4),
.attachments-upload-table td:nth-child(4) {
  width: 14%;
}

.attachments-upload-table th:nth-child(5),
.attachments-upload-table td:nth-child(5) {
  width: 10%;
}

.submit-attachments-table th,
.submit-attachments-table td {
  vertical-align: middle;
  font-size: 0.85rem;
}

.submit-attachments-file-name {
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submit-attachments-type-select {
  width: 100%;
  min-width: 160px;
}

.submit-attachments-table td.submit-attachments-status-cell {
  min-width: 128px;
  white-space: nowrap;
  word-break: normal;
}

.submit-attachments-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-weight: var(--font-weight-medium);
  min-width: 96px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.1);
  white-space: nowrap;
}

.attachments-upload-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.attachments-upload-status-detail {
  max-width: 28ch;
  line-height: 1.3;
  white-space: normal;
}

.attachments-inline-spinner {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1.75px solid currentColor;
  border-right-color: transparent;
  animation: button-spin 0.7s linear infinite;
  opacity: 0.85;
}

.submit-attachments-status.is-ready {
  color: var(--color-success);
}

.submit-attachments-status.is-uploading {
  color: var(--color-primary);
}

.submit-attachments-status.is-failed {
  color: var(--color-danger);
}

.submit-attachments-status.is-pending {
  color: var(--color-text-muted);
}

.submit-attachments-size {
  text-align: right;
  color: var(--color-text-muted);
}

.submit-attachments-actions {
  text-align: right;
}

@media (max-width: 960px) {
  .attachments-upload-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.history-row.expanded .history-row:hover .history-row-hint,
.history-row:focus-visible .history-row-hint,
.history-row.expanded .history-row:hover .history-row-hint,
.history-row:focus-visible .review-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: left;
}

.review-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.review-preview-item {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.review-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--review-attachments-width, 50%));
  gap: var(--space-3);
  align-items: stretch;
}

.review-preview-main {
  display: block;
  min-width: 0;
}

.review-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 0.9fr);
  gap: var(--space-4);
  align-items: start;
}

.review-preview-phase,
.review-preview-activity,
.review-preview-duration {
  min-width: 0;
}

.review-preview-activity {
  display: grid;
  gap: var(--space-2);
}

.review-preview-duration {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: var(--space-1);
}

.review-preview-duration-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  color: var(--color-text-muted);
}

.review-preview-duration-label::before {
  content: "";
  width: 23px;
  height: 23px;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.5a1 1 0 0 1 1 1V5a7 7 0 1 1-2 0V3.5a1 1 0 0 1 1-1Zm0 4.5a5.5 5.5 0 1 0 5.5 5.5A5.506 5.506 0 0 0 12 7Zm.5 2a1 1 0 0 1 1 1v2.086l1.207 1.207a1 1 0 0 1-1.414 1.414l-1.5-1.5a1 1 0 0 1-.293-.707V10a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.5a1 1 0 0 1 1 1V5a7 7 0 1 1-2 0V3.5a1 1 0 0 1 1-1Zm0 4.5a5.5 5.5 0 1 0 5.5 5.5A5.506 5.506 0 0 0 12 7Zm.5 2a1 1 0 0 1 1 1v2.086l1.207 1.207a1 1 0 0 1-1.414 1.414l-1.5-1.5a1 1 0 0 1-.293-.707V10a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.review-preview-duration-value {
  font-weight: var(--font-weight-semibold);
  font-size: 0.95rem;
}

.review-preview-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-self: stretch;
}

.review-preview-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
}

.review-preview-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.review-preview-title {
  padding-left: 8px;
  font-weight: var(--font-weight-semibold);
  font-size: 0.95rem;
}

.review-preview-status {
  font-size: 0.8rem;
}

.review-preview-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--status-pending-fg);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.review-preview-status-dot.status-new {
  background: var(--status-new-fg);
}

.review-preview-status-dot.status-announcement {
  background: var(--status-announcement-fg);
}

.review-preview-status-dot.status-updated {
  background: var(--status-updated-fg);
}

.review-preview-status-dot.status-completed {
  background: var(--status-completed-fg);
}

.review-preview-status-dot.status-rejected {
  background: var(--status-rejected-fg);
}

.review-preview-status-dot.status-cancelled,
.review-preview-status-dot.status-canceled {
  background: var(--status-canceled-fg);
}

.review-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.review-preview-text {
  margin: var(--space-1) 0;
  color: var(--color-text);
  text-align: left;
  display: -webkit-box;
  overflow: hidden;
}

.review-preview-text strong {
  font-weight: var(--font-weight-semibold);
}

.review-preview-attachments {
  border-radius: var(--radius-md);
}

.review-preview-side .review-preview-attachments {
  border: 1px solid var(--color-border);
  background: rgb(241, 241, 242);
  padding: var(--space-2);
  flex: 1;
}

.review-preview-side .review-preview-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.review-preview-side .review-preview-status {
  font-size: 0.7rem;
}

.review-preview-attachments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.review-preview-attachments-note {
  margin: var(--space-1) 0 0;
}

.review-preview-attachments-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 70px;
  gap: var(--space-3);
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.review-preview-thumb {
  position: relative;
  width: 80px;
  height: 100px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.review-preview-thumb.is-disabled {
  opacity: 0.6;
  cursor: default;
}

.review-preview-thumb.is-loaded .review-preview-thumb-label {
  opacity: 0;
}

.review-preview-thumb.is-loaded .review-preview-thumb-caption {
  opacity: 1;
}

.review-preview-thumb:hover {
  border-color: var(--color-primary);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.review-preview-thumb-label {
  font-size: 0.5rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  transition: opacity 0.2s ease;
}

.review-preview-thumb-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.review-preview-thumb-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  min-height: 28px;
  padding: 10px 4px 4px;
  color: #fff;
  font-size: 0.54rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.12;
  text-align: left;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0) 0%,
    rgba(15, 23, 42, 0.74) 58%,
    rgba(15, 23, 42, 0.9) 100%
  );
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.8);
  opacity: 0.9;
  pointer-events: none;
}

.review-preview-thumb-note {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--review-note-color, #facc15);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 2px 6px rgba(15, 23, 42, 0.22);
  z-index: 4;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.review-preview-thumb.has-note .review-preview-thumb-note {
  opacity: 1;
  transform: scale(1);
}

.review-preview-thumb-more {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  background: var(--color-surface-subtle);
}

.review-preview-thumb-popover {
  position: fixed;
  display: flex;
  gap: var(--space-3);
  box-sizing: border-box;
  width: min(480px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 10005;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.review-preview-thumb-popover.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.review-preview-thumb-popover-media {
  flex: 0 0 220px;
  width: 220px;
  height: 320px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.review-preview-thumb-popover-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.review-preview-thumb-popover-fallback {
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.review-preview-thumb-popover-meta {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow: hidden;
}

.review-preview-thumb-popover-title {
  font-weight: var(--font-weight-semibold);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.review-preview-thumb-popover-sub {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.review-preview-thumb-popover-details {
  display: grid;
  gap: var(--space-2);
  font-size: 0.8rem;
}

.review-preview-thumb-popover-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.review-preview-thumb-popover-key {
  flex: 0 0 auto;
  color: var(--color-text-muted);
}

.review-preview-thumb-popover-value {
  min-width: 0;
  font-weight: var(--font-weight-medium);
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .review-preview-thumb-popover {
    flex-direction: column;
    width: min(90vw, 360px);
  }

  .review-preview-thumb-popover-media {
    width: 100%;
    height: 220px;
  }

  .review-preview-thumb-popover-meta {
    min-width: 0;
  }
}

@media (max-width: 960px) {
  .review-preview-row {
    grid-template-columns: 1fr;
  }

  .review-preview-grid {
    grid-template-columns: 1fr;
  }

  .review-preview-duration {
    align-items: flex-start;
    text-align: left;
  }
}

.review-preview-empty,
.review-preview-error,
.review-preview-loading {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.review-history-modal .modal-dialog {
  width: min(1100px, 96vw);
}

.review-history-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.review-history-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.review-history-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.5fr) minmax(0, 1.5fr);
  gap: var(--space-4);
  align-items: start;
}

.review-history-transfer-meta {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
}

.review-history-transfer-meta-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.review-history-transfer-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

.review-history-transfer-chip.is-normal {
  color: #475569;
}

.review-history-transfer-chip.is-pending {
  color: #db1bab;
  background: rgba(81, 228, 40, 0.17);
}

.review-history-transfer-chip.is-accepted {
  color: #166534;
}

.review-history-transfer-chip.is-declined {
  color: #991b1b;
}

.review-history-transfer-chip.is-withdrawn,
.review-history-transfer-chip.is-transfer {
  color: #334155;
}

.review-history-transfer-meta-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.review-history-transfer-meta-note.is-error {
  color: var(--color-danger);
}

.review-history-transfer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-2) var(--space-3);
}

.review-history-transfer-meta-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 0.78rem;
}

.review-history-transfer-meta-item strong {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-history-transfer-meta-item span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text);
}

.review-history-transfer-rounds {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

.review-history-transfer-rounds-title {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
}

.review-history-transfer-round-list {
  display: grid;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.review-history-transfer-round {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-left: 3px solid #64748b;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.review-history-transfer-round.is-pending {
  border-left-color: #db1bab;
}

.review-history-transfer-round.is-accepted {
  border-left-color: #16a34a;
}

.review-history-transfer-round.is-declined {
  border-left-color: #dc2626;
}

.review-history-transfer-round.is-withdrawn,
.review-history-transfer-round.is-transfer {
  border-left-color: #64748b;
}

.review-history-transfer-round-main {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
}

.review-history-transfer-round-label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: var(--font-weight-semibold);
}

.review-history-transfer-round-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 8px;
  border-radius: 999px;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

.review-history-transfer-round-status.is-pending {
  color: #db1bab;
}

.review-history-transfer-round-status.is-accepted {
  color: #166534;
}

.review-history-transfer-round-status.is-declined {
  color: #991b1b;
}

.review-history-transfer-round-status.is-withdrawn,
.review-history-transfer-round-status.is-transfer {
  color: #334155;
}

.review-history-transfer-round-meta,
.review-history-transfer-round-reason {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text-muted);
  font-size: 0.76rem;
}

.review-history-phase,
.review-history-activity,
.review-history-duration {
  min-width: 0;
}

.review-history-grid-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 0 var(--space-2);
}

.review-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.review-history-item {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.review-history-loading,
.review-history-error,
.review-history-empty {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.review-history-phase-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.review-history-phase-title {
  font-weight: var(--font-weight-semibold);
}

.review-history-phase-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.review-history-activity {
  display: grid;
  gap: var(--space-2);
}

.review-history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.review-history-summary-item strong {
  font-weight: var(--font-weight-semibold);
}

.review-history-duration {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: var(--space-1);
}

.review-history-duration-header {
  align-items: stretch;
}

.review-history-duration-axis {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
}

.review-history-duration-axis-label {
  grid-column: 1;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.review-history-duration-axis-scale {
  grid-column: 2;
  position: relative;
  height: 16px;
  margin-top: 18px;
  border-radius: 999px;
  background-image: repeating-linear-gradient(
    to right,
    rgba(15, 23, 42, 0.12) 0,
    rgba(15, 23, 42, 0.12) 1px,
    transparent 1px,
    transparent calc(100% / var(--timeline-days, 1))
  );
}

.review-history-duration-axis-start,
.review-history-duration-axis-end {
  position: absolute;
  top: -18px;
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

.review-history-duration-axis-start {
  left: 0;
}

.review-history-duration-axis-end {
  right: 0;
}

.review-history-duration-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.review-history-duration-calendar {
  width: 100%;
  height: 24px;
  border-radius: 999px;
  background-color: var(--color-surface-subtle);
  background-image: repeating-linear-gradient(
    to right,
    rgba(15, 23, 42, 0.1) 0,
    rgba(15, 23, 42, 0.1) 1px,
    transparent 1px,
    transparent calc(100% / var(--timeline-days, 1))
  );
  position: relative;
  overflow: hidden;
}

.review-history-duration-range {
  position: absolute;
  top: 50%;
  z-index: 2;
  height: 9px;
  transform: translateY(-50%);
  background: var(--color-primary);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.review-history-duration-calendar.has-resubmit
  .review-history-duration-range.is-director {
  top: calc(50% + 6px);
}

.review-history-duration-range.is-resubmit {
  top: 3px;
  z-index: 1;
  height: 9px;
  transform: none;
  background: rgba(139, 92, 246, 0.45);
  border: none;
  box-shadow: none;
}

.review-history-duration-range.is-resubmit.is-late {
  background: rgba(239, 68, 68, 0.35);
}

.review-history-duration-range.is-open {
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    rgba(37, 99, 235, 0.3) 100%
  );
}

.review-history-duration-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  opacity: 0.6;
}

.review-history-duration-marker.is-warning {
  background: #f59e0b;
}

.review-history-duration-marker.is-overdue {
  background: #ef4444;
}

.review-history-duration-marker.is-resubmit {
  background: #8b5cf6;
}

.review-history-duration-marker.is-transfer {
  top: 2px;
  bottom: 2px;
  width: 6px;
  border-radius: 999px;
  opacity: 0.9;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.review-history-duration-marker.is-transfer-requested {
  background: #0ea5e9;
}

.review-history-duration-marker.is-transfer-accepted {
  background: #22c55e;
}

.review-history-duration-marker.is-transfer-declined {
  background: #ef4444;
}

.review-history-duration-marker.is-transfer-withdrawn {
  background: #64748b;
}

.review-history-duration-marker.is-hit {
  opacity: 1;
}

.review-history-duration-marker.is-pending {
  opacity: 0.35;
}

@media (max-width: 900px) {
  .review-history-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-history-grid-header {
    display: none;
  }

  .review-history-duration {
    align-items: flex-start;
    text-align: left;
  }

  .review-history-duration-summary {
    align-items: flex-start;
  }

  .review-history-duration-axis {
    display: none;
  }
}

.resizable-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-surface-subtle);
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.2);
}

.resizable-table tbody tr:hover {
  background: var(--color-neutral-soft);
}

.resizable-table tbody tr:last-child td {
  border-bottom: none;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 3;
}

.resize-handle::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1px;
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}

td[data-tooltip] {
  position: relative;
}

td[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + var(--space-2));
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  white-space: pre-line;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 5;
  box-shadow: var(--shadow-md);
  max-width: 320px;
  font-size: 0.9rem;
  line-height: 1.4;
}

td[data-tooltip]::before {
  content: "";
  position: absolute;
  left: var(--space-3);
  top: calc(100% + 4px);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(15, 23, 42, 0.92);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

td[data-tooltip]:hover::after,
td[data-tooltip]:hover::before {
  opacity: 1;
}

#assignmentTable tbody tr.assignment-row-highlight {
  position: relative;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#assignmentTable tbody tr.assignment-row-highlight-active {
  background: rgba(59, 130, 246, 0.12);
}

.data-table td[data-column-id="status"],
.data-table td[data-column-id="statusEmail"] {
  vertical-align: middle;
  text-align: center;
}

.resizable-table th[data-column-id="actors"],
.resizable-table td[data-column-id="actors"] {
  text-align: center;
}

.history-table-footer,
.summary-table-footer {
  display: flex;
  align-items: center;
  padding-left: 12px;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.table-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.admin-data-notice {
  margin-top: var(--space-2);
  padding-left: 12px;
  margin-bottom: var(--space-3);
}

.summary-refresh-field .secondary-button,
.performance-filter-actions .secondary-button {
  width: 100%;
}

.summary-table-footer .muted,
.history-table-footer .muted {
  margin: 0;
}

.history-inline-cancel-row td {
  background: var(--color-surface);
  border: 1.25px solid var(--color-border);
  border-top: none;
  padding: var(--space-4);
}

.inline-cancel-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.inline-cancel-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.inline-cancel-button {
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  color: var(--color-danger);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.inline-cancel-button:hover,
.inline-cancel-button:focus-visible {
  background: var(--color-danger-soft);
  color: var(--color-danger-hover);
  outline: none;
}

.inline-cancel-button[hidden] {
  display: none;
}

.inline-cancel-error {
  color: var(--color-danger);
  font-size: 0.85rem;
}

.assignment-card-mobile,
.history-card-mobile {
  display: none;
}

.history-date-time {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  line-height: 1.08;
  white-space: nowrap;
}

.history-date-line {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.history-time-line {
  font-size: 0.76rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}

.assignment-card-summary,
.history-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.assignment-card-id,
.history-card-id {
  font-weight: var(--font-weight-semibold);
  font-size: 1.05rem;
}

.assignment-card-status,
.history-card-status {
  cursor: default;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: var(--status-badge-min-width);
  min-height: var(--status-badge-height);
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  line-height: 1;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.01em;
  color: var(--status-pending-fg);
  border: 1.25px solid var(--color-border);
  text-transform: capitalize;
  white-space: nowrap;
}

.assignment-card-status .status-link,
.history-card-status .status-link {
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: inherit;
}

.assignment-card-status::before,
.history-card-status::before {
  content: "";
  width: var(--status-dot-size);
  height: var(--status-dot-size);
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}

.assignment-card-status.status-new,
.history-card-status.status-new {
  background: var(--status-new-bg);
  color: var(--status-new-fg);
}

.assignment-card-status.status-announcement,
.history-card-status.status-announcement {
  background: var(--status-announcement-bg);
  color: var(--status-announcement-fg);
}

.history-card-status.status-manual-request-pending {
  background: #fef3c7;
  color: #92400e;
}

.assignment-card-status.status-updated,
.history-card-status.status-updated {
  background: var(--status-updated-bg);
  color: var(--status-updated-fg);
}

.assignment-card-status.status-completed,
.history-card-status.status-completed {
  background: var(--status-completed-bg);
  color: var(--status-completed-fg);
}

.assignment-card-status.status-rejected,
.history-card-status.status-rejected {
  background: var(--status-rejected-bg);
  color: var(--status-rejected-fg);
}

.assignment-card-status.status-cancelled,
.assignment-card-status.status-canceled,
.history-card-status.status-cancelled,
.history-card-status.status-canceled {
  background: var(--status-canceled-bg);
  color: var(--status-canceled-fg);
}

.assignment-status-cell {
  display: inline-grid;
  grid-template-columns: var(--status-dot-size) max-content;
  align-items: center;
  justify-content: center;
  justify-items: center;
  column-gap: var(--space-3);
  line-height: 1.2;
  width: min(100%, 5.25rem);
  margin-inline: auto;
  min-height: 1.65rem;
  padding: 0 var(--space-2);
  border: 1px solid rgba(3, 105, 161, 0.28);
  border-radius: var(--radius-pill);
  background: transparent;
  font: inherit;
  text-align: left;
}

.assignment-status-stack {
  display: inline-grid;
  grid-template-columns: 1.05rem 5.25rem;
  align-items: center;
  justify-content: center;
  column-gap: 7px;
  width: calc(1.05rem + 7px + 5.25rem);
}

.assignment-alert-icon {
  width: 1.05rem;
  height: 1.05rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.7rem;
  line-height: 1;
  font-weight: 800;
  color: #b45309;
  background: rgba(255, 194, 99, 0);
  box-shadow: 0 0 0 2px rgba(241, 69, 142, 0.09);
}

.assignment-alert-icon.is-danger {
  color: #b91c1c;
}

.assignment-alert-icon.is-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.history-card-summary .assignment-alert-icon {
  margin-left: auto;
}

button.assignment-status-cell {
  cursor: pointer;
}

button.assignment-status-cell:hover .assignment-status-text,
button.assignment-status-cell:focus-visible .assignment-status-text {
  text-decoration: underline;
}

button.assignment-status-cell:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

td.status-clickable-cell {
  cursor: pointer;
}

.assignment-status-dot {
  width: var(--status-dot-size);
  height: var(--status-dot-size);
  border-radius: 999px;
  background: var(--status-pending-fg);
  flex-shrink: 0;
}

.assignment-status-cell.status-new .assignment-status-dot,
.assignment-status-cell.status-submitted .assignment-status-dot {
  background: var(--status-new-fg);
}

.assignment-status-cell.status-new,
.assignment-status-cell.status-submitted {
  border-color: rgba(29, 78, 216, 0.28);
}

.assignment-status-cell.status-announcement .assignment-status-dot {
  background: var(--status-announcement-fg);
}

.assignment-status-cell.status-announcement {
  border-color: rgba(15, 23, 42, 0.18);
}

.assignment-status-cell.status-updated .assignment-status-dot {
  background: var(--status-updated-fg);
}

.assignment-status-cell.status-updated {
  border-color: rgba(180, 83, 9, 0.28);
}

.assignment-status-cell.status-completed .assignment-status-dot {
  background: var(--status-completed-fg);
}

.assignment-status-cell.status-completed {
  border-color: rgba(22, 101, 52, 0.28);
}

.assignment-status-cell.status-rejected .assignment-status-dot {
  background: var(--status-rejected-fg);
}

.assignment-status-cell.status-rejected {
  border-color: rgba(185, 28, 28, 0.28);
}

.assignment-status-cell.status-cancelled .assignment-status-dot,
.assignment-status-cell.status-canceled .assignment-status-dot {
  background: var(--status-canceled-fg);
}

.assignment-status-cell.status-cancelled,
.assignment-status-cell.status-canceled {
  border-color: rgba(107, 33, 168, 0.28);
}

.assignment-status-text {
  min-width: 0;
  max-width: 100%;
  font-weight: var(--font-weight-semibold);
  text-transform: capitalize;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-card-meta,
.history-card-meta {
  display: none;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.assignment-card-meta span strong,
.history-card-meta span strong {
  margin-right: var(--space-1);
}

.assignment-card-details,
.history-card-details {
  display: none;
  margin-top: var(--space-3);
}

.assignment-card-details summary,
.history-card-details summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.95rem;
  color: var(--color-primary);
}

.assignment-card-details summary::marker,
.history-card-details summary::marker {
  color: var(--color-primary);
}

.assignment-card-details ul,
.history-card-details ul {
  list-style: none;
  padding-left: 0;
  margin: var(--space-3) 0 0;
  display: grid;
  gap: var(--space-2);
}

.assignment-card-details ul li,
.history-card-details ul li {
  color: inherit;
}

.assignment-card-details-content,
.history-card-details-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height var(--transition-base), opacity var(--transition-base);
}

.assignment-card-details[open] .assignment-card-details-content,
.history-card-details[open] .history-card-details-content {
  max-height: 480px;
  opacity: 1;
}

.details-toggle-icon {
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .assignment-cell-desktop {
    display: none;
  }

  .assignment-card-mobile {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .assignment-card-meta {
    display: flex;
  }

  .assignment-card-details {
    display: block;
  }
}

.notification-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 320px;
  pointer-events: none;
}

.notification-container.bottom-right {
  top: auto;
  right: var(--space-6);
  bottom: var(--space-6);
}

.notification-container.top-left {
  right: auto;
  left: var(--space-6);
}

.notification-toast {
  background: rgba(30, 41, 59, 0.88);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  pointer-events: auto;
  font-size: 0.95rem;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.notification-toast.chat {
  background: #ffffff;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  align-items: flex-start;
}

.notification-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  overflow: hidden;
}

.notification-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.notification-chat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.notification-chat-title {
  font-weight: 600;
  color: var(--color-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-chat-body {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-chat-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0 0 4px;
}

.notification-toast.compact {
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
}

.notification-toast.success {
  background: rgba(10, 111, 57, 0.85);
}

.notification-toast.error {
  background: rgba(220, 38, 38, 0.9);
}
.notification-toast.info {
  background: rgba(37, 99, 235, 0.9);
}
.notification-toast.warn,
.notification-toast.warning {
  background: rgba(234, 179, 8, 0.95);
}

.notification-toast button {
  background: none;
  border: none;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
}

.notification-toast.closing {
  opacity: 0;
  transform: translateY(-12px);
}

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

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: none;
  overscroll-behavior: contain;
}

body.modal-open .modal {
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  overflow-y: auto;
  min-height: 100vh;
  z-index: 3000;
  overscroll-behavior: contain;
}

.modal[hidden] {
  display: none;
}

.modal.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.attachments-preview-window.modal-island {
  display: block;
  align-items: initial;
  justify-content: initial;
  padding: 0;
  min-height: 0;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  width: 0;
  height: 0;
  overflow: visible;
}

body.modal-open .attachments-preview-window.modal-island {
  padding: 0;
  min-height: 0;
  overflow: visible;
}

.attachments-preview-window.modal-island .modal-backdrop {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  --modal-frame-border-color: rgba(71, 85, 105, 0.6);
  --modal-frame-ring-color: transparent;
  --modal-frame-inner-color: rgba(255, 255, 255, 0.72);
  --modal-frame-shadow: 0 24px 56px rgba(15, 23, 42, 0.16);
  width: min(800px, 96vw);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.25) transparent;
  background: var(--color-surface);
  background-clip: padding-box;
  -webkit-background-clip: padding-box;
  border-radius: var(--radius-xl);
  box-shadow: var(--modal-frame-shadow);
  border: 1px solid var(--modal-frame-border-color);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-dialog::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--modal-frame-inner-color);
}

.modal-dialog.qr-approve-dialog {
  width: min(640px, 96vw);
  height: min(680px, calc(100vh - 64px));
}

.notification-permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.notification-permission-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.notification-preferences-section {
  margin-bottom: var(--space-4);
}

.notification-preferences-section h4 {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}

.notification-preferences-grid {
  display: grid;
  gap: var(--space-2);
}

.notification-preferences-row {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: var(--space-3);
}

.notification-admin-only-tag {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(148, 163, 184, 0.35);
  color: #0f172a;
}

.notification-admin-only.is-admin-disabled .notification-admin-only-tag {
  display: inline-flex;
}

.notification-inbox-popup {
  position: absolute;
  border-radius: var(--radius-xl);
  right: 0;
  top: calc(100% + 12px);
  width: min(460px, 92vw);
  z-index: 60;
}

@media (max-width: 720px) {
  .notification-inbox-popup {
    right: -6px;
    width: min(360px, 96vw);
  }
}

.notification-inbox-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xl);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  padding: var(--space-4) var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: min(80vh, 720px);
  transition: max-height 220ms ease, box-shadow 220ms ease;
  will-change: max-height;
  overflow: hidden;
}

.notification-inbox-card.is-expanded {
  max-height: min(104vh, 936px);
}

.notification-inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.notification-inbox-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.notification-inbox-header h3 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.01em;
}

.notification-inbox-settings {
  font-size: 1.6rem;
  line-height: 1;
  padding: 0 var(--space-2);
}

.notification-inbox-menu {
  min-width: 340px;
}

.notification-inbox-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--font-weight-semibold);
}

.notification-inbox-menu-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #0f172a;
  flex: 0 0 auto;
}

.notification-inbox-menu-icon svg {
  width: 20px;
  height: 20px;
}

.notification-inbox-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 999px;
}

.notification-inbox-tab {
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: var(--font-weight-semibold);
  color: #0f172a;
  cursor: pointer;
}

.notification-inbox-tab:hover,
.notification-inbox-tab:focus-visible {
  background: rgba(148, 163, 184, 0.2);
  outline: none;
}

.notification-inbox-tab.is-active {
  background: #e7f3ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.notification-inbox-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  padding-right: var(--space-1);
  flex: 1 1 auto;
  min-height: 0;
}

.notification-inbox-groups {
  display: grid;
  gap: var(--space-3);
}

.notification-inbox-group {
  display: grid;
  gap: var(--space-2);
}

.notification-inbox-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 4px;
}

.notification-inbox-group-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: var(--font-weight-semibold);
  color: #0f172a;
}

.notification-inbox-list {
  display: grid;
  gap: 6px;
}

.notification-inbox-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: flex-start;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: var(--font-weight-medium);
}

.notification-inbox-item:hover,
.notification-inbox-item:focus-visible {
  background: #f1f5f9;
  outline: none;
}

.notification-inbox-item.is-unread {
  background: #e7f3ff;
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.notification-inbox-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-weight: var(--font-weight-semibold);
  color: #0f172a;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.notification-inbox-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notification-inbox-content {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.notification-inbox-title {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.3;
}

.notification-inbox-body-text {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-inbox-time {
  color: #1d4ed8;
  font-weight: var(--font-weight-semibold);
  font-size: 0.85rem;
}

.notification-inbox-unread-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1d4ed8;
  align-self: center;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.notification-inbox-item:not(.is-unread) .notification-inbox-unread-dot {
  visibility: hidden;
}

.notification-inbox-empty {
  text-align: center;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}

.notification-inbox-loading {
  text-align: center;
  margin-top: var(--space-2);
}

.notification-inbox-footer {
  display: flex;
  justify-content: center;
}

.modal-dialog.is-resizable {
  width: auto;
  height: auto;
  min-width: min(420px, calc(100vw - 64px));
  min-height: 320px;
  max-width: none;
  max-height: var(
    --modal-resize-max-height,
    calc(var(--modal-visual-viewport-height, 100dvh) - 64px)
  );
  overflow-y: auto;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.modal-dialog.is-resizable .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-dialog.is-resizable .modal-resize-handle {
  display: block;
}

.modal-dialog.is-resizing {
  cursor: var(--modal-resize-cursor, nwse-resize);
  transition: none !important;
  user-select: none;
  will-change: width, height;
}

.modal-dialog.is-resizing * {
  user-select: none;
}

body.modal-resize-active,
body.modal-resize-active * {
  cursor: var(--modal-resize-cursor, nwse-resize) !important;
}

body.modal-resize-active .modal-backdrop,
body.modal-resize-active .modal-dialog,
body.modal-resize-active .modal-dialog .modal-header {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.modal-resize-active .modal-dialog {
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}

body.modal-drag-active,
body.modal-drag-active * {
  cursor: grabbing !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.modal-resize-handle {
  display: none;
  position: absolute;
  z-index: 8;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.modal-resize-handle[data-modal-resize-edge="n"],
.modal-resize-handle[data-modal-resize-edge="s"] {
  left: 34px;
  right: 34px;
  height: 12px;
  cursor: ns-resize;
}

.modal-resize-handle[data-modal-resize-edge="n"] {
  top: -5px;
  z-index: 1;
}

.modal-resize-handle[data-modal-resize-edge="s"] {
  bottom: 0;
  height: 6px;
}

.modal-resize-handle[data-modal-resize-edge="e"],
.modal-resize-handle[data-modal-resize-edge="w"] {
  top: 34px;
  bottom: 34px;
  width: 12px;
  cursor: ew-resize;
}

.modal-resize-handle[data-modal-resize-edge="e"] {
  right: -5px;
}

.modal-resize-handle[data-modal-resize-edge="w"] {
  left: -5px;
}

.modal-resize-handle[data-modal-resize-edge="n"]::before,
.modal-resize-handle[data-modal-resize-edge="s"]::before,
.modal-resize-handle[data-modal-resize-edge="e"]::before,
.modal-resize-handle[data-modal-resize-edge="w"]::before {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0);
  transition: background var(--transition-fast);
}

.modal-resize-handle[data-modal-resize-edge="n"]::before,
.modal-resize-handle[data-modal-resize-edge="s"]::before {
  left: 0;
  right: 0;
  height: 3px;
}

.modal-resize-handle[data-modal-resize-edge="n"]::before {
  top: 4px;
}

.modal-resize-handle[data-modal-resize-edge="s"]::before {
  bottom: 4px;
}

.modal-resize-handle[data-modal-resize-edge="e"]::before,
.modal-resize-handle[data-modal-resize-edge="w"]::before {
  top: 0;
  bottom: 0;
  width: 3px;
}

.modal-resize-handle[data-modal-resize-edge="e"]::before {
  right: 4px;
}

.modal-resize-handle[data-modal-resize-edge="w"]::before {
  left: 4px;
}

.modal-resize-handle[data-modal-resize-edge="n"]:hover::before,
.modal-resize-handle[data-modal-resize-edge="s"]:hover::before,
.modal-resize-handle[data-modal-resize-edge="e"]:hover::before,
.modal-resize-handle[data-modal-resize-edge="w"]:hover::before,
.modal-resize-handle[data-modal-resize-edge="n"]:active::before,
.modal-resize-handle[data-modal-resize-edge="s"]:active::before,
.modal-resize-handle[data-modal-resize-edge="e"]:active::before,
.modal-resize-handle[data-modal-resize-edge="w"]:active::before {
  background: rgba(37, 99, 235, 0.34);
}

.modal-resize-handle[data-modal-resize-edge="nw"],
.modal-resize-handle[data-modal-resize-edge="ne"],
.modal-resize-handle[data-modal-resize-edge="sw"],
.modal-resize-handle[data-modal-resize-edge="se"] {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(100, 116, 139, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 4px 14px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.modal-resize-handle[data-modal-resize-edge="nw"],
.modal-resize-handle[data-modal-resize-edge="se"] {
  cursor: nwse-resize;
}

.modal-resize-handle[data-modal-resize-edge="ne"],
.modal-resize-handle[data-modal-resize-edge="sw"] {
  cursor: nesw-resize;
}

.modal-resize-handle[data-modal-resize-edge="nw"] {
  top: 10px;
  left: 10px;
  z-index: 1;
}

.modal-resize-handle[data-modal-resize-edge="ne"] {
  top: 10px;
  right: 10px;
  z-index: 1;
}

.modal-resize-handle[data-modal-resize-edge="sw"] {
  bottom: 10px;
  left: 10px;
}

.modal-resize-handle[data-modal-resize-edge="se"] {
  right: 10px;
  bottom: 10px;
}

.modal-resize-handle[data-modal-resize-edge="nw"]::before,
.modal-resize-handle[data-modal-resize-edge="ne"]::before,
.modal-resize-handle[data-modal-resize-edge="sw"]::before,
.modal-resize-handle[data-modal-resize-edge="se"]::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
}

.modal-resize-handle[data-modal-resize-edge="nw"]::after,
.modal-resize-handle[data-modal-resize-edge="ne"]::after,
.modal-resize-handle[data-modal-resize-edge="sw"]::after,
.modal-resize-handle[data-modal-resize-edge="se"]::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
}

.modal-resize-handle[data-modal-resize-edge="nw"]::before,
.modal-resize-handle[data-modal-resize-edge="nw"]::after {
  top: 5px;
  left: 5px;
  border-top: 2px solid rgba(37, 99, 235, 0.72);
  border-left: 2px solid rgba(37, 99, 235, 0.72);
}

.modal-resize-handle[data-modal-resize-edge="nw"]::after {
  top: 9px;
  left: 9px;
  border-color: rgba(71, 85, 105, 0.62);
}

.modal-resize-handle[data-modal-resize-edge="ne"]::before,
.modal-resize-handle[data-modal-resize-edge="ne"]::after {
  top: 5px;
  right: 5px;
  border-top: 2px solid rgba(37, 99, 235, 0.72);
  border-right: 2px solid rgba(37, 99, 235, 0.72);
}

.modal-resize-handle[data-modal-resize-edge="ne"]::after {
  top: 9px;
  right: 9px;
  border-color: rgba(71, 85, 105, 0.62);
}

.modal-resize-handle[data-modal-resize-edge="sw"]::before,
.modal-resize-handle[data-modal-resize-edge="sw"]::after {
  bottom: 5px;
  left: 5px;
  border-bottom: 2px solid rgba(37, 99, 235, 0.72);
  border-left: 2px solid rgba(37, 99, 235, 0.72);
}

.modal-resize-handle[data-modal-resize-edge="sw"]::after {
  bottom: 9px;
  left: 9px;
  border-color: rgba(71, 85, 105, 0.62);
}

.modal-resize-handle[data-modal-resize-edge="se"]::before,
.modal-resize-handle[data-modal-resize-edge="se"]::after {
  right: 5px;
  bottom: 5px;
  border-right: 2px solid rgba(37, 99, 235, 0.72);
  border-bottom: 2px solid rgba(37, 99, 235, 0.72);
}

.modal-resize-handle[data-modal-resize-edge="se"]::after {
  right: 9px;
  bottom: 9px;
  border-color: rgba(71, 85, 105, 0.62);
}

.modal-resize-handle:hover,
.modal-resize-handle:active {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(239, 246, 255, 0.96);
}

.modal-resize-handle,
.modal-resize-handle:hover,
.modal-resize-handle:active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.modal-resize-handle::before,
.modal-resize-handle::after {
  content: none !important;
  display: none !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.modal-dialog::-webkit-scrollbar {
  width: 6px;
}

.modal-dialog::-webkit-scrollbar-track {
  background: transparent;
}

.modal-dialog::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.2);
  border-radius: 999px;
}

.modal-dialog:hover::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.35);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  position: relative;
  flex-wrap: nowrap;
  padding-right: 0;
  margin: 12px;
  margin-right: 0px;
  margin-bottom: 0;
  z-index: 2;
}

.modal-header > :not(.modal-header-actions) {
  min-width: 0;
  order: 1;
}

.modal-header h1,
.modal-header h2,
.modal-header h3 {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  min-width: 0;
}

.modal-title-block .attachments-preview-meta {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  position: static;
  padding-right: 6px;
  margin-left: 12px;
  order: 2;
  right: auto;
  top: auto;
  transform: none;
  white-space: nowrap;
  z-index: 3;
}

.modal-header > .modal-close {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  margin-left: auto;
  align-self: flex-start;
  order: 2;
  flex: 0 0 auto;
}

.modal-dialog .modal-header.modal-window-header {
  align-items: center;
  gap: 10px;
  margin: 0;
  border-radius: 0;
  cursor: grab;
}

.modal-dialog .modal-header.modal-window-header:active {
  cursor: grabbing;
}

.modal-dialog.attachments-window-dialog {
  --modal-frame-border-color: rgba(71, 85, 105, 0.66);
  --modal-frame-ring-color: transparent;
  --modal-frame-inner-color: rgba(255, 255, 255, 0.82);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
}

.modal-dialog.attachments-window-dialog .modal-header.attachments-window-header {
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin: 0;
  padding: 7px 10px;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(246, 247, 249, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.68) inset,
    0 10px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  cursor: grab;
}

.modal-dialog.attachments-window-dialog
  .modal-header.attachments-window-header:active {
  cursor: grabbing;
}

.modal-dialog.attachments-window-dialog .modal-title-block {
  flex: 1 1 auto;
  min-width: 0;
}

.modal-dialog.attachments-window-dialog .modal-title-block h3 {
  margin: 0;
  color: #3f3f46;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.18;
}

.modal-dialog.attachments-window-dialog .modal-title-block .muted {
  color: #71717a;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.16;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-dialog.attachments-window-dialog .modal-header-actions {
  align-self: center;
  gap: 10px;
  padding-right: 4px;
}

.modal-dialog.attachments-window-dialog .modal-header-actions .modal-close,
.modal-dialog.attachments-window-dialog .modal-header-actions .modal-minimize-dot,
.modal-dialog.attachments-window-dialog .modal-header-actions .modal-reset-chip {
  width: 1rem;
  height: 1rem;
}

.modal-dialog.modal-workflow-dialog {
  --modal-frame-border-color: rgba(71, 85, 105, 0.62);
  --modal-frame-ring-color: transparent;
  --modal-frame-inner-color: rgba(255, 255, 255, 0.82);
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
}

.modal-dialog.modal-workflow-dialog > .modal-body {
  padding: var(--space-2);
}

.modal-dialog.modal-workflow-dialog > .modal-actions,
.modal-dialog.modal-workflow-dialog > .action-buttons {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
  margin: 8px;
}

.modal-dialog.modal-workflow-dialog
  .modal-header.modal-workflow-header {
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(248, 250, 252, 0.86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  cursor: grab;
}

.modal-dialog.modal-workflow-dialog
  .modal-header.modal-workflow-header:active {
  cursor: grabbing;
}

.modal-dialog.modal-workflow-dialog .modal-title-block {
  flex: 1 1 auto;
  min-width: 0;
}

.modal-dialog.modal-workflow-dialog .modal-title-block h3 {
  margin: 0;
  color: #334155;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
}

.modal-dialog.modal-workflow-dialog .modal-title-block .eyebrow-text {
  margin: 0 0 2px;
  font-size: 0.7rem;
  line-height: 1.1;
}

.modal-dialog.modal-workflow-dialog .modal-title-block .muted {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-dialog.modal-workflow-dialog .modal-header-actions {
  align-self: center;
  gap: 10px;
  padding-right: 4px;
}

.modal-dialog.modal-workflow-dialog .modal-header-actions .modal-close,
.modal-dialog.modal-workflow-dialog .modal-header-actions .modal-reset-chip {
  width: 1rem;
  height: 1rem;
}

.modal-dialog.modal-form-dialog {
  --modal-frame-border-color: rgba(71, 85, 105, 0.58);
  --modal-frame-ring-color: transparent;
  --modal-frame-inner-color: rgba(255, 255, 255, 0.84);
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
}

.modal-dialog.modal-form-dialog > .modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-2) var(--space-2) var(--space-2);
}

.modal-dialog.modal-form-dialog > .modal-actions,
.modal-dialog.modal-form-dialog > .action-buttons {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
  margin-bottom: 10px;
}

.modal-dialog.modal-form-dialog .modal-header.modal-form-header {
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  cursor: grab;
}

.modal-dialog.modal-form-dialog .modal-header.modal-form-header:active {
  cursor: grabbing;
}

.modal-dialog.modal-form-dialog .modal-title-block {
  flex: 1 1 auto;
  min-width: 0;
}

.modal-dialog.modal-form-dialog .modal-title-block h3 {
  margin: 0;
  color: #334155;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
}

.modal-dialog.modal-form-dialog .modal-title-block .muted {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-dialog.modal-form-dialog .modal-header-actions {
  align-self: center;
  gap: 10px;
  padding-right: 4px;
}

.modal-dialog.modal-form-dialog .modal-header-actions .modal-close,
.confirm-modal-dialog.modal-minimal-dialog .modal-header-actions .modal-close {
  width: 1rem;
  height: 1rem;
}

.confirm-modal-dialog.modal-minimal-dialog {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.confirm-modal-dialog.modal-minimal-dialog > .modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4) var(--space-4) var(--space-3);
}

.confirm-modal-dialog.modal-minimal-dialog > .modal-actions {
  padding: 0 var(--space-4) var(--space-4);
}

.confirm-modal-dialog.modal-minimal-dialog .modal-header.modal-minimal-header {
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 8px 10px 8px var(--space-4);
  border-radius: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.88);
}

.confirm-modal-dialog.modal-minimal-dialog .modal-title-block {
  flex: 1 1 auto;
  min-width: 0;
}

.confirm-modal-dialog.modal-minimal-dialog .modal-title-block h3 {
  margin: 0;
  color: #334155;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
}

.confirm-modal-dialog.modal-minimal-dialog .modal-header-actions {
  align-self: center;
  gap: 10px;
  padding-right: 4px;
}

#actionModal .confirm-modal-dialog.has-action-inputs {
  width: min(720px, calc(100vw - 32px));
  height: auto;
  min-height: 0;
  max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 32px);
  overflow: hidden;
}

#actionModal .confirm-modal-dialog.has-multiple-inputs {
  width: min(760px, calc(100vw - 32px));
}

#actionModal .confirm-modal-dialog.has-action-inputs > .modal-body {
  display: grid;
  gap: var(--space-3);
  min-height: 0;
  max-height: min(62vh, 560px);
  overflow-y: auto;
  padding: var(--space-5) var(--space-5) var(--space-4);
}

#actionModal .confirm-modal-dialog.has-action-inputs > .modal-actions {
  flex: 0 0 auto;
  position: static;
  margin-top: 0;
  padding: var(--space-3) var(--space-5) var(--space-5);
  background: var(--color-surface);
}

#actionModal .confirm-modal-dialog.has-action-inputs #actionModalExtra {
  display: grid;
  gap: var(--space-3);
}

#actionModal .confirm-modal-dialog.has-action-inputs #actionModalExtra label {
  margin: 0 0 calc(var(--space-2) * -1);
  color: var(--color-heading);
  font-weight: var(--font-weight-semibold);
}

#actionModal .confirm-modal-dialog.has-action-inputs .modal-textarea {
  min-height: 112px;
  resize: vertical;
}

#actionModal .confirm-modal-dialog.has-multiple-inputs .modal-textarea {
  min-height: 96px;
}

.attachments-diff-modal .modal-header {
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: var(--space-2);
}

.attachments-diff-modal
  .modal-dialog.attachments-preview-dialog--compact
  .attachments-diff-header {
  z-index: 18;
  background: rgba(248, 250, 252, 0.96);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.78) inset,
    0 12px 28px rgba(15, 23, 42, 0.11);
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
}

.attachments-diff-modal
  .modal-dialog.attachments-preview-dialog--compact
  .attachments-diff-header::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 18px;
  background: linear-gradient(
    to bottom,
    rgba(248, 250, 252, 0.52),
    rgba(248, 250, 252, 0)
  );
  pointer-events: none;
}

.attachments-diff-modal .attachments-diff-header .modal-title-block {
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
}

.attachments-diff-modal .attachments-diff-header-actions {
  align-self: flex-start;
  flex: 0 0 auto;
  margin-left: auto;
  margin-top: 2px;
  position: relative;
  z-index: 20;
}

.attachments-diff-modal.attachments-diff-modal--mobile .attachments-diff-header {
  align-items: center;
}

.attachments-diff-modal .attachments-diff-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.28rem;
  font-weight: 780;
  line-height: 1.12;
}

.attachments-diff-back-button {
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base), color var(--transition-base);
}

.attachments-diff-back-button:hover,
.attachments-diff-back-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.55);
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.attachments-diff-modal .attachments-diff-back-button {
  display: none;
}

.attachments-preview-back-button {
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color var(--transition-base), background var(--transition-base),
    box-shadow var(--transition-base), color var(--transition-base);
}

.attachments-preview-back-button:hover,
.attachments-preview-back-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.55);
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.modal-header-actions .modal-close,
.modal-header-actions .modal-reset-chip {
  position: static;
  top: auto;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.modal-minimize-dot {
  position: static;
  top: auto;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #fbbf24;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.15);
  transition: background var(--transition-fast), transform var(--transition-fast);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.modal-minimize-dot::before {
  content: "";
  display: block;
  width: 8px;
  height: 2px;
  background: #7c2d12;
  border-radius: 999px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.modal-minimize-dot:hover,
.modal-minimize-dot:focus-visible {
  background: #fcd34d;
  outline: none;
  transform: translateY(-1px);
}

.modal-minimize-dot:hover::before,
.modal-minimize-dot:focus-visible::before,
.modal-minimize-dot:active::before {
  opacity: 1;
}

.attachments-preview-window.is-minimized {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.attachments-preview-window.is-minimized .modal-dialog {
  display: none;
}

.attachments-preview-window.is-minimized .modal-backdrop {
  display: none;
}

.modal.is-minimized#attachmentsModal {
  visibility: visible;
  opacity: 1;
  pointer-events: none;
}

#attachmentsModal.is-minimized .modal-dialog {
  display: none;
}

#attachmentsModal.is-minimized .modal-backdrop {
  display: none;
}

#attachmentsModal .attachments-modal-minibar {
  display: none;
  position: fixed;
  --minibar-width: 240px;
  --minibar-gap: 12px;
  left: calc(
    var(--space-4) +
      (var(--minibar-index, 0) * (var(--minibar-width) + var(--minibar-gap)))
  );
  bottom: var(--space-4);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border-strong);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  width: var(--minibar-width);
  min-width: var(--minibar-width);
  max-width: var(--minibar-width);
  z-index: 9999;
  cursor: pointer;
}

#attachmentsModal.is-minimized .attachments-modal-minibar {
  display: inline-flex;
  pointer-events: auto;
}

#attachmentsModal .attachments-modal-minibar:focus-visible {
  outline: none;
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.attachments-preview-window .attachments-preview-minibar {
  display: none;
  position: fixed;
  --minibar-width: 240px;
  --minibar-gap: 12px;
  left: calc(
    var(--space-4) +
      (var(--minibar-index, 0) * (var(--minibar-width) + var(--minibar-gap)))
  );
  bottom: var(--space-4);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border-strong);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  width: var(--minibar-width);
  min-width: var(--minibar-width);
  max-width: var(--minibar-width);
  z-index: 9999;
}

.attachments-preview-window.is-minimized .attachments-preview-minibar {
  display: inline-flex;
  pointer-events: auto;
}

.attachments-preview-minibar-popover {
  position: fixed;
  z-index: 10000;
  display: none;
  pointer-events: none;
}

.attachments-preview-minibar-popover.is-visible {
  display: block;
}

.attachments-preview-minibar-popover-card {
  width: 280px;
  background: var(--color-surface);
  border: 1.25px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.attachments-preview-minibar-popover-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-preview-minibar-popover-meta {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.attachments-preview-minibar-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
}

.attachments-preview-minibar-thumb.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.75rem;
  background: linear-gradient(120deg, #f1f5f9, #e2e8f0, #f1f5f9);
  background-size: 200% 100%;
  animation: minibar-thumb-shimmer 1.2s ease-in-out infinite;
}

@keyframes minibar-thumb-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.attachments-preview-minibar-docx-thumb {
  width: 100%;
  height: 140px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.attachments-preview-minibar-docx-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--color-muted);
}

.attachments-preview-minibar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.attachments-preview-minibar-grid-label {
  font-size: 0.7rem;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.attachments-preview-minibar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: none;
  flex: 1 1 auto;
}

.attachments-preview-minibar-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.minibar-dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  border: 1.25px solid transparent;
  background: #e2e8f0;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.minibar-dot--close {
  background: #ff5f57;
  border-color: #d1433a;
}

.minibar-dot--restore {
  background: rgb(78, 228, 40);
  border-color: rgba(55, 180, 32, 0.9);
}

.minibar-dot:hover,
.minibar-dot:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.05);
  outline: none;
}

.modal-reset-chip,
.app-resize-chip {
  border: 1.25px solid rgb(78, 228, 40);
  background: rgb(78, 228, 40);
  color: #30de2b4f;
  font-weight: 600;
  border-radius: 999px;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-base), border var(--transition-base);
  font-size: 0.6rem;
  line-height: 1;
  padding: 0;
}

.modal-reset-chip {
  position: absolute;
  top: var(--space-5);
  right: calc(var(--space-5) + 1.4rem);
}

.modal-reset-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.modal-reset-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f8fafc;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-1px);
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 40;
}

.modal-reset-wrap.is-open .modal-reset-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.modal-reset-menu-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
}

.modal-reset-menu-title--secondary {
  margin-top: 4px;
}

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

.modal-reset-menu-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-reset-option {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 6px;
  cursor: pointer;
  transition: border var(--transition-base), background var(--transition-base);
}

.modal-reset-option--preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
}

.modal-reset-option--preset .modal-reset-label {
  display: none;
}

.modal-reset-icon {
  position: relative;
  width: 28px;
  height: 20px;
  border: 2px solid #0f172a;
  border-radius: 5px;
  background: #fff;
  box-sizing: border-box;
}

.modal-reset-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  background: #0f172a;
  border-radius: 3px;
  width: calc(100% - 6px);
}

.modal-reset-icon--30::before {
  width: calc((100% - 6px) * 0.3);
}

.modal-reset-icon--50::before {
  width: calc((100% - 6px) * 0.5);
}

.modal-reset-icon--50r::before {
  width: calc((100% - 6px) * 0.5);
  left: auto;
  right: 3px;
}

.modal-reset-icon--70::before {
  width: calc((100% - 6px) * 0.7);
}

.modal-reset-icon--100::before {
  width: calc(100% - 6px);
}

.modal-reset-icon--u30::before,
.modal-reset-icon--u50::before,
.modal-reset-icon--u70::before {
  top: 50%;
  left: 50%;
  bottom: auto;
  right: auto;
  transform: translate(-50%, -50%);
}

.modal-reset-icon--u30::before {
  width: calc((100% - 6px) * 0.3);
  height: calc((100% - 6px) * 0.3);
}

.modal-reset-icon--u50::before {
  width: calc((100% - 6px) * 0.5);
  height: calc((100% - 6px) * 0.5);
}

.modal-reset-icon--u70::before {
  width: calc((100% - 6px) * 0.7);
  height: calc((100% - 6px) * 0.7);
}

.modal-reset-label {
  font-size: 0.68rem;
  color: #0f172a;
}

.modal-reset-option:hover {
  border-color: #1d4ed8;
  background: #eff6ff;
}

.modal-reset-option.is-fullscreen {
  width: 100%;
}

.app-resize-chip {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
}

.modal-reset-chip:hover,
.app-resize-chip:hover {
  background: rgb(10, 193, 22);
  border-color: rgb(27, 204, 24);
}

.modal-reset-chip:focus-visible,
.app-resize-chip:focus-visible {
  outline: 2px solid rgba(35, 208, 26, 0.5);
  outline-offset: 2px;
}

.modal-dialog--sm {
  width: clamp(320px, 60%, 600px);
  padding: var(--space-5);
  gap: var(--space-3);
}

.confirm-modal-dialog {
  position: relative;
  --modal-frame-border-color: rgba(71, 85, 105, 0.6);
  --modal-frame-ring-color: transparent;
  width: min(400px, 92vw);
  height: min(250px, 90vh);
  max-height: min(250px, 90vh);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.25) transparent;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.16);
  border: 1.25px solid var(--modal-frame-border-color);
  padding: var(--space-4);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Submit/resubmit modal: mở ở kích thước làm việc tốt hơn trên desktop */
.submit-modal-dialog.modal-dialog {
  width: min(1080px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  height: min(780px, calc(var(--modal-visual-viewport-height, 100dvh) - 48px));
  max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 48px);
}

.submit-modal-dialog.modal-dialog,
.submit-modal-dialog.modal-dialog.is-resizable {
  overflow: hidden;
}

.submit-modal-dialog .modal-body {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] .modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  padding-right: 0;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-layout {
  display: contents;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-flow-row {
  display: none;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-card--entity {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: start;
  min-width: 0;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-card--entity .submit-finalize-subject-field {
  margin-top: var(--space-4);
}

#submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-card--detail {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-self: start;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(243, 247, 239, 0.37);
  scrollbar-width: thin;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-card--detail .form-field {
  margin: 0;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] #noteInput {
  min-height: 132px;
  padding: 10px 11px;
  line-height: 1.4;
  resize: vertical;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] #submitInlineAttachments {
  display: none !important;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] .modal-actions {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(190px, 0.95fr) minmax(220px, 1.05fr);
  gap: 10px;
  position: relative;
  bottom: auto;
  z-index: 2;
  margin-top: 4px;
  padding-top: 10px;
  padding-right: 4px;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] .modal-actions button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  justify-content: center;
  white-space: nowrap;
}

#submitModal[data-submit-mode="finalizeAnnouncement"] #saveAnnouncementButton {
  display: none !important;
}

/* Attachments manage modal: đủ rộng cho bảng file + ghi chú và chỉ giữ 1 vùng cuộn chính */
.attachments-modal-dialog.modal-dialog {
  width: min(1200px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  height: min(820px, calc(var(--modal-visual-viewport-height, 100dvh) - 48px));
  max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 48px);
}

.attachments-modal-dialog.modal-dialog,
.attachments-modal-dialog.modal-dialog.is-resizable {
  overflow: hidden;
}

.attachments-modal-dialog .modal-body {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-modal-section,
#attachmentsModal[data-attachments-mode="manage"] .attachments-modal-block,
#attachmentsModal[data-attachments-mode="manage"] #attachmentsModalHost,
#attachmentsModal[data-attachments-mode="manage"] .attachments-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

#attachmentsModal.is-visible[data-attachments-mode="manage"] {
  pointer-events: none;
}

#attachmentsModal.is-visible[data-attachments-mode="manage"] .modal-backdrop {
  display: none;
}

#attachmentsModal.is-visible[data-attachments-mode="manage"] .attachments-modal-dialog {
  pointer-events: auto;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-modal-block {
  padding: 0;
  border: none;
  background: transparent;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-panel {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  overflow: hidden;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "table"
    "upload";
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  align-items: start;
  overflow: hidden;
  gap: var(--space-3);
}

#attachmentsModal[data-attachments-mode="manage"]
  .attachments-list-layout.attachments-list-layout--with-rail {
  grid-template-columns: minmax(340px, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "table table"
    "upload rail";
  align-items: stretch;
}

#attachmentsModal[data-attachments-mode="manage"]
  .attachments-list-layout
  .attachments-table-container {
  grid-area: table;
  align-self: stretch;
  min-width: 0;
  margin-top: 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-table {
  width: max(100%, 960px);
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-table th,
#attachmentsModal[data-attachments-mode="manage"] .attachments-table td {
  white-space: nowrap;
  word-break: normal;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-side-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: stretch;
  justify-self: start;
  width: min(100%, 760px);
  min-width: 0;
  max-width: 760px;
  min-height: 0;
  overflow: hidden;
}

#attachmentsModal[data-attachments-mode="manage"]
  .attachments-list-layout.attachments-list-layout--with-rail[data-note-count="1"]
  .attachments-side-rail {
  width: 360px;
  max-width: 360px;
}

#attachmentsModal[data-attachments-mode="manage"]
  .attachments-list-layout.attachments-list-layout--with-rail[data-note-count="2"]
  .attachments-side-rail {
  width: 700px;
  max-width: 700px;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-upload {
  grid-area: upload;
  margin-top: 0;
  position: static;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
  min-width: 320px;
  width: 100%;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-upload.submit-modal-card {
  height: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

#attachmentsModal[data-attachments-mode="manage"]
  .attachments-upload
  .submit-modal-card__header {
  margin-bottom: var(--space-2);
  flex: 0 0 auto;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-upload-staging {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: var(--space-2);
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-upload-dropzone {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
}

#attachmentsModal[data-attachments-mode="manage"]
  .attachments-upload-dropzone
  .import-dropzone-content {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  text-align: left;
}

#attachmentsModal[data-attachments-mode="manage"]
  .attachments-upload-dropzone
  .import-dropzone-icon {
  width: 32px;
  height: 32px;
  margin: 0;
  flex: 0 0 auto;
}

#attachmentsModal[data-attachments-mode="manage"]
  .attachments-upload-dropzone
  .import-dropzone-hint {
  font-size: 0.82rem;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-upload-table-container {
  min-height: 180px;
  max-height: min(320px, 34vh);
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-upload-table-container.is-empty {
  overflow: hidden;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-upload-table {
  width: max(100%, 960px);
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-upload-table th,
#attachmentsModal[data-attachments-mode="manage"] .attachments-upload-table td {
  white-space: nowrap;
  word-break: normal;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-note-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: var(--space-1);
  gap: var(--space-3);
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-note-panel-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 320px);
  grid-template-rows: 1fr;
  align-items: stretch;
  align-content: stretch;
  gap: var(--space-3);
  justify-content: start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-right: 0;
  scroll-snap-type: x proximity;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-note-panel-item {
  width: auto;
  min-width: 0;
  min-height: 156px;
  padding: var(--space-3);
  gap: 6px;
  align-content: start;
  scroll-snap-align: start;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-note-panel-item-title {
  font-size: 0.88rem;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-note-panel-item-body {
  -webkit-line-clamp: 4;
}

#attachmentsModal[data-attachments-mode="manage"]
  .attachments-note-panel-item-quote-preview
  p {
  -webkit-line-clamp: 4;
}

#attachmentsModal[data-attachments-mode="manage"] .attachments-row-document,
#attachmentsModal[data-attachments-mode="manage"] .attachments-row-title,
#attachmentsModal[data-attachments-mode="manage"] .attachments-row-level1 {
  scroll-margin-block: 96px;
}

@media (max-width: 1024px) {
  #attachmentsModal[data-attachments-mode="manage"] .attachments-list-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "table"
      "upload"
      "rail";
    align-items: start;
  }

  #attachmentsModal[data-attachments-mode="manage"] .attachments-side-rail,
  #attachmentsModal[data-attachments-mode="manage"] .attachments-note-panel {
    width: 100%;
    min-width: 0;
  }

  #attachmentsModal[data-attachments-mode="manage"] .attachments-side-rail {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  #attachmentsModal[data-attachments-mode="manage"] .attachments-note-panel-list {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-rows: none;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
    padding-bottom: 0;
  }

  #attachmentsModal[data-attachments-mode="manage"] .attachments-note-panel-item {
    width: 100%;
    min-height: 0;
  }

  #attachmentsModal[data-attachments-mode="manage"] .attachments-upload-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  #attachmentsModal[data-attachments-mode="manage"] .attachments-upload-actions {
    margin-left: 0;
    justify-content: flex-start;
  }
}

#resubmitModal .modal-dialog,
.resubmit-modal-dialog {
  width: min(960px, calc(100vw - 48px));
  height: min(780px, calc(var(--modal-visual-viewport-height, 100dvh) - 48px));
  min-height: min(560px, calc(var(--modal-visual-viewport-height, 100dvh) - 48px));
  max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 48px);
}

.modal-message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1.25px solid var(--color-border);
  font: inherit;
}

.modal-textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: var(--color-primary);
}

.modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1.25px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
}

.modal-list li {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1.25px solid rgba(15, 23, 42, 0.06);
  line-height: 1.4;
}

.modal-list li:last-child {
  border-bottom: none;
}

.review-process-modal {
  width: min(960px, 95vw);
  max-height: calc(100vh - 40px);
}

.review-process-modal-assignment {
  margin: 3px 0 0;
  max-width: min(620px, 68vw);
}

.resubmit-modal-assignment {
  margin: 3px 0 0;
  max-width: min(620px, 68vw);
}

.submit-modal-assignment {
  margin: 3px 0 0;
  max-width: min(720px, 70vw);
}

.review-process-modal .modal-body {
  max-height: none;
  overflow: hidden;
}

.specialist-import-modal .modal-dialog,
.director-import-modal .modal-dialog,
.group-import-modal .modal-dialog {
  width: min(1300px, 96vw);
  height: min(830px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
}

.specialist-import-body,
.director-import-body,
.group-import-body {
  gap: var(--space-1);
}

.import-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.import-summary-card {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  flex-direction: column;
  display: flex;
}

.import-summary-card .summary-list {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-3);
  width: 100%;
}

.import-summary-card .summary-list > div {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--color-surface-subtle);
  min-height: 120px;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
}

.import-summary-card .summary-list > div dt {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.import-summary-card .summary-list > div dd {
  margin: 0;
  font-size: 1.4rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.summary-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
}

.summary-chip-value {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  cursor: pointer;
}

.summary-chip-value:disabled {
  color: var(--color-text-muted);
  cursor: default;
}

.import-table-wrapper {
  max-height: min(100vh, 940px);
  overflow-x: auto;
  overflow-y: auto;
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  scroll-behavior: smooth;
}

.virtualized-table-container {
  max-height: 1000px;
  overflow-y: auto;
}

.import-preview-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: fixed;
}

.import-preview-table th,
.import-preview-table td {
  padding: 8px 10px;
  border-bottom: 1.25px solid var(--color-border-subtle);
  vertical-align: top;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-preview-table th:first-child,
.import-preview-table td:first-child {
  width: 48px;
  max-width: 56px;
  text-align: center;
}

.import-preview-table th:nth-child(2),
.import-preview-table td:nth-child(2) {
  width: 120px;
  max-width: 140px;
}

.specialist-import-table {
  min-width: 1020px;
}
.specialist-import-table th:nth-child(3),
.specialist-import-table td:nth-child(3) {
  width: 200px;
}
.specialist-import-table th:nth-child(4),
.specialist-import-table td:nth-child(4) {
  width: 170px;
}
.specialist-import-table th:nth-child(5),
.specialist-import-table td:nth-child(5) {
  width: 110px;
}
.specialist-import-table th:nth-child(6),
.specialist-import-table td:nth-child(6),
.specialist-import-table th:nth-child(7),
.specialist-import-table td:nth-child(7) {
  width: 170px;
}
.specialist-import-table th:nth-child(8),
.specialist-import-table td:nth-child(8) {
  width: 120px;
}
.specialist-import-table th:nth-child(9),
.specialist-import-table td:nth-child(9) {
  width: 90px;
}
.specialist-import-table th:nth-child(10),
.specialist-import-table td:nth-child(10) {
  width: 200px;
  white-space: normal;
  overflow: visible;
}

.director-import-table {
  min-width: 1040px;
}
.director-import-table th:nth-child(3),
.director-import-table td:nth-child(3) {
  width: 200px;
}
.director-import-table th:nth-child(4),
.director-import-table td:nth-child(4) {
  width: 170px;
}
.director-import-table th:nth-child(5),
.director-import-table td:nth-child(5) {
  width: 170px;
}
.director-import-table th:nth-child(6),
.director-import-table td:nth-child(6) {
  width: 110px;
  text-align: right;
}
.director-import-table th:nth-child(7),
.director-import-table td:nth-child(7) {
  width: 140px;
}
.director-import-table th:nth-child(8),
.director-import-table td:nth-child(8) {
  width: 200px;
  white-space: normal;
  overflow: visible;
}
.director-import-table th:nth-child(9),
.director-import-table td:nth-child(9) {
  width: 200px;
  white-space: normal;
  overflow: visible;
}

.group-import-table {
  min-width: 1040px;
}
.group-import-table th:nth-child(3),
.group-import-table td:nth-child(3) {
  width: 140px;
}
.group-import-table th:nth-child(4),
.group-import-table td:nth-child(4) {
  width: 180px;
}
.group-import-table th:nth-child(5),
.group-import-table td:nth-child(5) {
  width: 190px;
}
.group-import-table th:nth-child(6),
.group-import-table td:nth-child(6) {
  width: 140px;
}
.group-import-table th:nth-child(7),
.group-import-table td:nth-child(7) {
  width: 200px;
  white-space: normal;
  overflow: visible;
}
.group-import-table th:nth-child(8),
.group-import-table td:nth-child(8) {
  width: 200px;
  white-space: normal;
  overflow: visible;
}

.import-preview-table tbody tr:last-child td {
  border-bottom: none;
}

.import-preview-table tbody tr.import-row-error {
  background: rgba(220, 38, 38, 0.08);
}

.import-preview-table tbody tr.import-row-warning {
  background: rgba(249, 115, 22, 0.08);
}

.import-preview-table tbody tr.import-row-highlight {
  position: relative;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.import-preview-table tbody tr.import-row-highlight-active {
  background: rgba(59, 130, 246, 0.12);
}

#assignmentImportStandardPreviewWrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.assignment-import-scroll .table-container {
  overflow-x: auto;
  max-width: 100%;
}

.assignment-import-scroll .import-preview-table {
  min-width: 1400px;
  table-layout: auto;
}

#assignmentImportStandardPreviewWrapper[hidden],
#vtigerReviewContainer[hidden] {
  display: none;
}

.vtiger-review-container {
  margin-top: 0px;
  border: 0px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px;
  background: var(--color-surface, #fff);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: min(100vh, 1200px);
}

.vtiger-review-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--color-surface, #fff);
  border-radius: var(--radius-xl);

}

.vtiger-review-toolbar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.vtiger-review-toolbar-row--top,
.vtiger-review-toolbar-row--bottom {
  justify-content: space-between;
  flex-wrap: wrap;
}

.vtiger-review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.vtiger-review-filter {
  border: 1.25px solid var(--color-border);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  background: #fff;
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.2;
  font-weight: var(--font-weight-medium);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base);
}

.vtiger-review-filter.is-active {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: inset 0 1px 0 rgba(99, 102, 241, 0.12);
}

.vtiger-review-filter:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.vtiger-review-filter[disabled] {
  opacity: 0.65;
  cursor: default;
}

.vtiger-filter-count {
  font-weight: var(--font-weight-semibold);
}

.vtiger-review-meta-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.vtiger-review-weight-panel {
  position: fixed;
  top: var(--space-6);
  right: var(--space-4);
  bottom: var(--space-6);
  width: var(--weight-panel-width);
  min-width: 320px;
  max-width: 520px;
  z-index: 56;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  background: rgba(241, 245, 249, 0.6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.vtiger-review-weight-panel.is-dirty {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  background: rgba(226, 232, 240, 0.7);
}

.vtiger-review-weight-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  position: relative;
  padding-right: 0;
}

.vtiger-review-weight-body {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-right: 0.2rem;
}

.vtiger-review-weight-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-2);
}

.vtiger-review-weight-section:first-child {
  border-top: none;
  padding-top: 0;
}

.vtiger-review-weight-section h6 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.vtiger-review-weight-advanced {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-2);
}

.vtiger-review-weight-advanced summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
}

.vtiger-review-weight-advanced summary::-webkit-details-marker {
  display: none;
}

.vtiger-review-weight-advanced summary::after {
  content: "▾";
  font-size: 0.8rem;
  color: var(--color-muted);
  transition: transform 0.2s ease;
}

.vtiger-review-weight-advanced[open] summary::after {
  transform: rotate(180deg);
}

.vtiger-review-weight-collapsible-body {
  margin-top: var(--space-2);
}

.vtiger-review-weight-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
}

.vtiger-review-weight-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: auto;
}

.vtiger-review-weight-status {
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #fff;
  color: var(--color-muted);
}

.vtiger-review-weight-panel.is-dirty .vtiger-review-weight-status {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.08);
}

.vtiger-review-weight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}

.vtiger-review-weight-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.vtiger-review-weight-presets {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.vtiger-review-weight-presets select {
  flex: 1 1 200px;
  min-width: 160px;
}

.vtiger-review-weight-preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.vtiger-review-weight-preset-actions input[type="text"] {
  flex: 1 1 200px;
  min-width: 160px;
}

.vtiger-review-weight-action-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.vtiger-review-weight-action-menu .action-menu {
  right: 0;
  left: auto;
  top: calc(100% + 6px);
}

.vtiger-review-weight-action-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vtiger-review-weight-preset-note {
  margin: 0;
}

.vtiger-review-weight-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.vtiger-preview-mode-toggle--compact {
  padding: 0.15rem 0.25rem;
}

.vtiger-preview-mode-toggle--compact .vtiger-preview-mode-label {
  font-size: 0.78rem;
}

.vtiger-preview-mode-toggle--compact .vtiger-preview-mode-btn {
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
}

.vtiger-review-weight-panel .is-disabled {
  opacity: 0.55;
}

.vtiger-review-weight-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.vtiger-review-toggle {
  width: 100%;
  justify-content: space-between;
  padding: 0.2rem 0;
}

.vtiger-review-toggle .toggle-switch-label {
  font-size: 0.85rem;
}

.vtiger-review-weight-penalty {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vtiger-review-weight-penalty-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border-subtle);
  background: rgba(255, 255, 255, 0.75);
}

.vtiger-review-weight-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.vtiger-review-weight-field span {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.vtiger-review-weight-field input {
  width: 100%;
}

.vtiger-review-weight-field select {
  width: 100%;
}

.vtiger-review-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  width: 100%;
  justify-content: flex-start;
}

.vtiger-review-toolbar-right .vtiger-review-search {
  width: auto;
  flex: 1 1 auto;
  max-width: none;
  min-width: 200px;
}

.vtiger-review-sort-label {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: var(--font-weight-medium);
}

.vtiger-review-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem;
  border-radius: 999px;
  border: 1.25px solid var(--color-border);
  background: #fff;
}

.vtiger-review-sort-button {
  border: none;
  background: transparent;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    color var(--transition-base);
}

.vtiger-review-sort-button.is-active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
  box-shadow: inset 0 1px 0 rgba(99, 102, 241, 0.12);
}

.vtiger-review-sort-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.vtiger-review-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  background: var(--color-surface);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--color-text);
}

.summary-chip--warn {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
  color: #b45309;
}

.summary-chip--muted {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.3);
  color: #475569;
}

.vtiger-review-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 220px;
  padding-right: 4px;
}

.vtiger-review-cards {
  display: grid;
  width: 100%;
}

.vtiger-review-empty {
  text-align: center;
  padding: var(--space-4);
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(241, 245, 249, 0.4);
}

.vtiger-review-load-more {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  justify-self: center;
}

.vtiger-review-load-more:hover,
.vtiger-review-load-more:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  outline: none;
}

.vtiger-review-card {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
  margin: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  position: relative;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.vtiger-review-card:not(.is-collapsed) {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.12);
}

.vtiger-review-card.is-collapsed .vtiger-review-body,
.vtiger-review-card.is-collapsed .vtiger-review-actions,
.vtiger-review-card.is-collapsed .vtiger-review-footer {
  display: none;
}

.vtiger-review-card--attention {
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.18);
}

.vtiger-review-card--notify {
  border-color: rgba(59, 130, 246, 0.5);
}

.vtiger-review-card--excluded {
  opacity: 0.65;
  filter: grayscale(8%);
  background: #f8fafc;
}

.vtiger-review-card-header {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  justify-content: space-between;
}

.vtiger-review-chevron {
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid rgba(100, 116, 139, 0.9);
  border-bottom: 2px solid rgba(100, 116, 139, 0.9);
  transform: rotate(45deg);
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  transition: transform var(--transition-base), border-color var(--transition-base);
}

.vtiger-review-card:not(.is-collapsed) .vtiger-review-chevron {
  transform: rotate(-135deg);
  border-color: rgba(37, 99, 235, 0.9);
}


.vtiger-review-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  grid-template-areas: "header summary";
  gap: var(--space-3);
  align-items: start;
  width: 100%;
}

.vtiger-review-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.vtiger-card-quick-action {
  border: none;
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  border-radius: 999px;
  width: 1.25rem;
  height: 1.25rem;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
}

.vtiger-card-quick-action:hover,
.vtiger-card-quick-action:focus-visible {
  background: rgba(239, 68, 68, 0.25);
  color: #991b1b;
}

.vtiger-review-card.is-collapsed .vtiger-card-quick-action {
  display: inline-flex;
}

.vtiger-review-row-label {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  font-size: 1rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.vtiger-review-subject {
  margin: 0.2rem 0 0;
  color: var(--color-muted);
  font-size: 0.92rem;
  max-width: 44ch;
  word-break: break-word;
}

.vtiger-review-card-header {
  grid-area: header;
  width: 100%;
}

.vtiger-review-collapsed-summary {
  grid-area: summary;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0.35rem;
  align-items: start;
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.vtiger-review-collapsed-summary p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  word-break: break-word;
  justify-content: flex-end;
}

.vtiger-review-manual-badge {
  padding: 0.12rem 0.45rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vtiger-review-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  display: inline-flex;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.vtiger-review-dot--ok {
  background: #22c55e;
}

.vtiger-review-dot--warning {
  background: #f59e0b;
}

.vtiger-review-dot--error {
  background: #ef4444;
}

@media (max-width: 900px) {
  .vtiger-review-card-top {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "summary";
  }

  .vtiger-review-collapsed-summary {
    text-align: right;
  }

  .vtiger-review-container {
    max-height: 75vh;
  }
}

.vtiger-review-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  column-gap: var(--space-4);
  row-gap: var(--space-3);
}

@media (min-width: 1100px) {
  .vtiger-review-body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.vtiger-review-card-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vtiger-review-card-column dl {
  margin: 0;
}

.vtiger-review-info {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vtiger-review-info div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.vtiger-review-info dt {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.vtiger-review-info dd {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  word-break: break-word;
}

.vtiger-review-load {
  display: block;
  color: var(--color-muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.vtiger-review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--color-muted);
  border-top: 1px dashed var(--color-border-subtle);
  padding-top: var(--space-2);
}

.vtiger-review-card.import-row-highlight,
.vtiger-review-card.import-row-highlight-active {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.vtiger-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  align-items: flex-start;
  justify-content: space-between;
}

.vtiger-review-actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  flex: 1 1 auto;
}

.vtiger-review-actions-right {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.vtiger-review-director-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--color-muted);
}

.vtiger-review-director-select {
  min-width: 240px;
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.35rem 0.6rem;
  font-size: 0.88rem;
  background: #fff;
  color: var(--color-text);
  max-height: 600px;
  overflow-y: auto;
}

.vtiger-review-action {
  border: 1.25px solid var(--color-border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  background: rgba(248, 250, 252, 0.9);
  color: var(--color-muted);
  cursor: pointer;
}

.vtiger-review-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.vtiger-review-action--danger {
  border-color: rgba(248, 113, 113, 0.4);
  color: #b91c1c;
}

@media (max-width: 860px) {
  .vtiger-review-body {
    flex-direction: column;
  }
}


.import-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  padding: 0.25rem 0.5rem;
  min-width: 88px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.import-status-new,
.import-status-create,
.import-status-success {
  color: var(--color-success, #166534);
}

.import-status-update {
  color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.1);
}

.import-status-skip {
  color: var(--color-muted, #475569);
  background-color: rgba(148, 163, 184, 0.18);
}

.import-status-error {
  color: var(--color-danger, #b91c1c);
}

.import-note {
  color: var(--color-muted, #475569);
  font-size: 0.85rem;
  line-height: 1.4;
}

.specialist-import-actions,
.director-import-actions,
.group-import-actions {
  flex-wrap: wrap;
  padding-bottom: 8px;
}

.specialist-import-actions .primary-button,
.director-import-actions .primary-button,
.group-import-actions .primary-button {
  min-width: 160px;
}

.specialist-import-actions.import-complete {
  justify-content: flex-end;
}

.specialist-import-actions.import-complete > :not([data-close-specialist-import]) {
  display: none !important;
}

.import-preview-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.review-process-modal.transfer-open {
  transform: translateY(-40px);
  transition: transform var(--transition-base);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  cursor: move;
}

.modal-header h3 {
  margin: 0;
}

.modal-header .modal-close {
  cursor: pointer;
}

.modal-actions,
.modal .action-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: auto;
  width: 100%;
  padding-top: var(--space-2);
  position: sticky;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.98),
    rgba(255, 255, 255, 0.92),
    rgba(255, 255, 255, 0.88),
    transparent
  );
  z-index: 1;
}

.modal-actions-spacer {
  flex: 1 1 auto;
}

.modal-actions .modal-footer-right {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.modal-actions button,
.modal-actions .primary-button,
.modal-actions .secondary-button,
.modal-actions .danger-button,
.modal-actions .ghost-button,
.modal-actions label.primary-button,
.modal-actions label.secondary-button,
.modal-actions label.danger-button,
.modal-actions label.ghost-button,
.modal .action-buttons button,
.modal .action-buttons .primary-button,
.modal .action-buttons .secondary-button,
.modal .action-buttons .danger-button,
.modal .action-buttons .ghost-button,
.modal .action-buttons label.primary-button,
.modal .action-buttons label.secondary-button,
.modal .action-buttons label.danger-button,
.modal .action-buttons label.ghost-button {
  box-shadow: none;
  height: 44px;
  min-height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-actions button:hover:not(:disabled),
.modal .action-buttons button:hover:not(:disabled) {
  box-shadow: none;
}

.modal-actions button:focus-visible,
.modal .action-buttons button:focus-visible {
  box-shadow: none;
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.data-load-settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-fieldset {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.settings-legend {
  font-weight: var(--font-weight-semibold);
  font-size: 1rem;
  margin-bottom: var(--space-2);
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.settings-label {
  font-weight: var(--font-weight-semibold);
}

.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-medium);
}

.radio-inline + .radio-inline {
  margin-left: var(--space-4);
}

.modal .action-buttons {
  width: 100%;
}

.modal .action-buttons button {
  flex: 0 0 auto;
}


.modal-close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 1.0rem;
  height: 1.0rem;
  border-radius: 999px;
  border: 1.25px solid #d1433a;
  background: #ff5f57;
  color: transparent;
  font-size: 0;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  padding: 0;
  border-width: 1px;
}

.modal-close::before {
  content: "X";
  font-size: 0.85rem;
  color: transparent;
  justify-content: center;
  transition: color var(--transition-fast);
}

.modal-close:hover,
.modal-close:focus-visible {
  background: #ff7b72;
  outline: none;
  transform: translateY(-1px);  
}

.modal-close:hover::before,
.modal-close:focus-visible::before {
  color: #350404;
}

@media (hover: none), (pointer: coarse) {
  .modal-header {
    cursor: default;
  }

  .modal-dialog .modal-header.modal-window-header {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .modal-dialog.attachments-window-dialog .modal-header.attachments-window-header {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .modal-dialog.modal-workflow-dialog .modal-header.modal-workflow-header {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .modal-dialog.modal-form-dialog .modal-header.modal-form-header {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .modal-header .modal-close,
  .modal-header .modal-minimize-dot,
  .modal-header .modal-reset-chip {
    position: relative;
    inset: auto;
    transform: none;
    touch-action: manipulation;
  }

  .modal-header .modal-close::after,
  .modal-header .modal-minimize-dot::after,
  .modal-header .modal-reset-chip::after {
    content: "";
    position: absolute;
    inset: -14px;
  }

  .modal-reset-menu .modal-reset-option {
    min-height: 40px;
  }
}

.history-card-status.clickable-status {
  cursor: pointer;
}
body.modal-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.245);
  backdrop-filter: blur(1px);
  z-index: 2500;
}

body.modal-open.preview-modal-passive::before {
  opacity: 0;
  pointer-events: none;
}

body.modal-open {
  overflow-y: auto;
}

.transfer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-3);
}

.transfer-menu {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
  margin-right: auto;
}

.transfer-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--transition-base),
    background var(--transition-base), color var(--transition-base),
    box-shadow var(--transition-base);
  min-width: 0;
}

.transfer-menu-toggle:hover,
.transfer-menu-toggle:focus-visible {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.transfer-menu-toggle span[aria-hidden="true"] {
  font-size: 1.4rem;
  line-height: 1;
}

.transfer-menu-popover {
  position: fixed;
  top: -9999px;
  left: -9999px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1.25px solid var(--color-border-strong, var(--color-border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast),
    visibility var(--transition-fast);
  min-width: 13.5rem;
  z-index: 20;
}

.transfer-menu.is-open .transfer-menu-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.transfer-menu-item {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1.25px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast);
  font-weight: var(--font-weight-medium);
  text-align: left;
}

.transfer-menu-item:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.transfer-menu-separator {
  height: 1px;
  background: var(--color-border);
  margin: 2px var(--space-1);
}

.transfer-menu-item-info {
  color: var(--color-text);
}

.transfer-menu-item-readonly {
  color: var(--color-text);
}

.transfer-menu-item-info:hover,
.transfer-menu-item-info:focus-visible,
.transfer-menu-item-readonly:hover,
.transfer-menu-item-readonly:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.06);
  color: var(--color-primary);
}

.transfer-menu-item:disabled,
.transfer-menu-item[aria-disabled="true"] {
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.transfer-menu-item-accept {
  color: var(--color-success, #166534);
}

.transfer-menu-item-accept:hover,
.transfer-menu-item-accept:focus-visible {
  border-color: rgba(34, 197, 94, 0.7);
}

.transfer-menu-item-decline {
  color: var(--color-danger, #b91c1c);
}

.transfer-menu-item-decline:hover,
.transfer-menu-item-decline:focus-visible {
  border-color: rgba(239, 68, 68, 0.7);
}

.transfer-info-dialog {
  width: min(760px, calc(100vw - 32px));
  text-align: left;
  overflow-x: hidden;
}

.transfer-info-dialog .modal-header {
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  border-radius: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  cursor: default;
}

.transfer-info-dialog .modal-title-block {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 0;
}

.transfer-info-dialog .modal-title-block h3 {
  margin: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.15;
}

.transfer-info-dialog .modal-title-block .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transfer-info-dialog .modal-header-actions {
  flex: 0 0 auto;
  align-self: flex-start;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  padding: 12px;
}

.transfer-info-dialog .modal-header-actions .modal-close,
.transfer-info-dialog .modal-header-actions .modal-reset-chip {
  position: static;
  inset: auto;
  transform: none;
  width: 1rem;
  height: 1rem;
}

.transfer-info-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.transfer-info-summary {
  display: grid;
  gap: var(--space-3);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.transfer-info-summary h4 {
  margin: 0;
  font-size: 1.05rem;
}

.transfer-info-summary p {
  margin: 0;
}

.transfer-info-summary-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-6);
}

.transfer-info-summary-meta .transfer-info-field {
  grid-template-columns: 100px 1fr;
  padding: 0;
  border-bottom: none;
}

.transfer-info-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.transfer-info-group {
  display: flex;
  flex-direction: column;
}

.transfer-info-group-header {
  font-size: 0.6875rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: var(--space-1);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-border);
}

.transfer-info-field {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.transfer-info-field:last-child {
  border-bottom: none;
}

.transfer-info-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.transfer-info-value {
  color: var(--color-text);
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .transfer-info-dialog .modal-header {
    gap: var(--space-3);
  }

  .transfer-info-dialog .modal-title-block .muted {
    white-space: normal;
  }

  .transfer-info-field {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .transfer-info-label {
    white-space: normal;
  }

  .transfer-info-summary-meta {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .transfer-info-summary-meta .transfer-info-field {
    grid-template-columns: 1fr;
  }
}

.review-schedule-layout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: flex-start;
  margin-bottom: var(--space-5);
}

.review-schedule-calendar,
.review-schedule-sidebar {
  background: var(--color-surface);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
}

.review-schedule-calendar {
  flex: 1 1 360px;
  min-width: 300px;
}

.review-schedule-sidebar {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: sticky;
  top: var(--space-6);
}

.review-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.calendar-nav-button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.4rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition-base),
    background var(--transition-base), color var(--transition-base),
    box-shadow var(--transition-base);
}

.calendar-nav-button:hover,
.calendar-nav-button:focus-visible {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.review-calendar-current {
  font-weight: var(--font-weight-semibold);
  font-size: 1.05rem;
  text-transform: capitalize;
}

.review-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
  width: 100%;
}

.review-calendar-weekday {
  text-align: center;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-calendar-day {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1.25px solid transparent;
  background: rgba(15, 23, 42, 0.04);
  color: inherit;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.review-calendar-day:hover,
.review-calendar-day:focus-visible {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
  outline: none;
}

.review-calendar-day.is-outside {
  color: var(--color-text-muted);
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
}

.review-calendar-day.is-today::after {
  content: "";
  position: absolute;
  inset: 0.25rem;
  border: 1.25px dashed var(--color-primary);
  border-radius: var(--radius-md);
  pointer-events: none;
}

.review-calendar-day.is-booked {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-danger, #b91c1c);
  border-color: rgba(239, 68, 68, 0.3);
}

.review-calendar-day.is-selected-start,
.review-calendar-day.is-selected-end,
.review-calendar-day.is-selected-single {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.review-calendar-day.is-selected-range {
  background: rgba(37, 99, 235, 0.14);
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.2);
}

.review-calendar-day.is-selected-range.is-booked {
  background: rgba(37, 99, 235, 0.18);
}

.review-schedule-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.schedule-preset-button {
  border-radius: var(--radius-pill);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  padding: var(--space-1) var(--space-3);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition-base),
    background var(--transition-base), color var(--transition-base),
    box-shadow var(--transition-base);
}

.schedule-preset-button:hover,
.schedule-preset-button:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.review-schedule-sidebar .action-buttons {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--space-3);
}

.review-schedule-sidebar .action-buttons button {
  min-width: 0;
  width: 100%;
}

.review-schedule-sidebar textarea {
  min-height: 96px;
}

#updateSpecialistModal {
  align-items: center;
}

#createGroupModal .modal-dialog {
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

#createGroupModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: var(--space-1);
  padding-bottom: var(--space-3);
}

#createGroupModal .modal-actions {
  margin-top: auto;
  padding-top: var(--space-3);
}

#updateGroupModal .modal-dialog {
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

#updateGroupModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: var(--space-1);
  padding-bottom: var(--space-3);
}

.import-wizard {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.vtiger-session-board {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-xxl);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.vtiger-session-board-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.vtiger-session-board-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.vtiger-session-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
  margin: 0;
}

.vtiger-session-stats dt {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.vtiger-session-stats dd {
  margin: 0.15rem 0 0;
  font-size: 1.4rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.vtiger-session-table table {
  width: 100%;
  border-collapse: collapse;
}

.vtiger-session-table th,
.vtiger-session-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 0.9rem;
  text-align: left;
}

.vtiger-session-table tbody tr.is-active {
  background: rgba(37, 99, 235, 0.05);
}

.vtiger-session-table .session-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.vtiger-session-create {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vtiger-session-create label {
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.vtiger-session-create-fields {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.vtiger-session-create-fields input {
  flex: 1 1 320px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
}

.vtiger-session-create-fields button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.vtiger-session-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
  background: rgba(148, 163, 184, 0.2);
  color: var(--color-heading);
}

.vtiger-session-status-pill.status-active,
.vtiger-session-status-pill.status-ready_for_commit,
.vtiger-session-status-pill.status-caching {
  background: rgba(37, 99, 235, 0.15);
  color: var(--color-primary);
}

.vtiger-session-status-pill.status-committed,
.vtiger-session-status-pill.status-completed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.vtiger-session-status-pill.status-failed,
.vtiger-session-status-pill.status-cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-danger);
}

.import-tab-switch {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-3);
}

.import-tab-switch-slot {
  display: inline-flex;
  align-items: center;
}

.import-tab-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.vtiger-weight-toggle-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vtiger-weight-toggle-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.settings-panel-header .import-tab-switch,
.settings-panel-header .import-tab-preview-toggle {
  margin-bottom: 0;
}

.import-tab {
  border: 1px solid #d9e2ec;
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.import-tab.is-active {
  background: #0b6efd;
  border-color: #0b6efd;
  color: #fff;
}

.import-mode-switch {
  display: inline-flex;
  padding: 0.35rem;
  background: rgba(226, 232, 240, 0.6);
  border-radius: 999px;
  gap: 0.35rem;
  align-self: flex-start;
}

.import-mode-option {
  border: none;
  background: transparent;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition-base);
}

.import-mode-option.is-active {
  background: var(--color-surface);
  color: var(--color-heading);
  box-shadow: var(--shadow-sm);
}

.import-mode-description {
  margin-top: var(--space-2);
  color: var(--color-muted);
  font-size: 0.9rem;
}

.vtiger-import-notice {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-xl);
  border: 1.5px dashed rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.06);
  color: var(--color-heading);
}

.vtiger-import-notice ul {
  margin: var(--space-2) 0 0;
  padding-left: 1.2rem;
  color: var(--color-text);
}


.import-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
}

.import-stepper-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  position: relative;
}

.import-stepper-row .import-stepper {
  flex: 1;
  min-width: 0;
}

.import-stepper-info {
  position: relative;
  flex-shrink: 0;
}

.import-stepper-info summary {
  list-style: none;
  cursor: pointer;
}

.import-stepper-info summary::-webkit-details-marker {
  display: none;
}

.import-stepper-info {
  display: none;
}

.import-stepper-info-popover {
  position: absolute;
  right: 0;
  top: 36px;
  min-width: 280px;
  max-width: 360px;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  z-index: 6;
}

.import-stepper-info-grid {
  margin: 0;
  display: grid;
  gap: 6px;
}

.import-stepper-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.9rem;
}

.import-stepper-info-row dt {
  color: var(--color-text-muted);
  font-weight: 500;
}

.import-stepper-info-row dd {
  margin: 0;
  color: var(--color-text-strong);
  font-weight: 600;
}

.import-upload-indicator {
  display: none;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: 0.9rem;
}

.import-upload-indicator.is-visible {
  display: flex;
}

.import-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-border);
  flex-shrink: 0;
}

.import-status-dot.is-ready {
  background: var(--color-warning);
}

.import-status-dot.is-uploading {
  background: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  animation: import-dot-pulse 1.2s ease-out infinite;
}

.import-status-dot.is-success {
  background: var(--color-success);
}

.import-status-dot.is-error {
  background: var(--color-danger);
}

.import-status-panel {
  border: 1.25px solid var(--color-border);
  background: rgba(37, 99, 235, 0.04);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  display: none;
  flex-direction: column;
  gap: var(--space-2);
}

.import-status-panel.is-visible {
  display: flex;
}

.import-status-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.import-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.import-status-actions button[hidden] {
  display: none;
}

.import-file-summary-card {
  margin-top: var(--space-3);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1.25px solid var(--color-border-subtle);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  align-items: center;
}

.import-file-card-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.import-file-card-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.import-file-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.import-file-card-name {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
  font-size: 1.3rem;
  word-break: break-word;
}

.import-file-card-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-2);
  font-size: 0.85rem;
}

.import-file-card-list dt {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
}

.import-file-card-list dd {
  margin: 0.2rem 0 0;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.import-file-card-sheet {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1.25px dashed var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.import-sheet-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.import-sheet-list label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1.25px solid var(--color-border-subtle);
  background: rgba(148, 163, 184, 0.15);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
}

.import-sheet-list label.is-selected {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.15);
  color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.import-sheet-list input[type="radio"] {
  display: none;
}

.import-auto-retry {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.import-auto-retry .auto-retry-checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-medium);
  color: var(--color-heading);
}

.import-auto-retry input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

#assignmentImportUploadButton.import-upload-button--progress {
  position: relative;
  background-image: linear-gradient(
    to right,
    var(--upload-progress-color, var(--color-success, #16a34a)) var(--upload-progress, 0%),
    var(--upload-progress-color, var(--color-success, #16a34a)) var(--upload-progress, 0%),
    rgba(148, 163, 184, 0.3) var(--upload-progress, 0%),
    rgba(148, 163, 184, 0.3) 100%
  );
  color: var(--color-heading);
  border-color: var(--upload-progress-color, var(--color-success, #16a34a));
  transition: background-image var(--transition-base), color var(--transition-base);
}

#assignmentImportUploadButton.import-upload-button--progress:disabled {
  opacity: 1;
}

.import-status-heading {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.import-status-log {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  max-height: 10rem;
  overflow-y: auto;
  border: 1.25px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
}

.import-status-log li {
  display: flex;
  gap: var(--space-2);
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  line-height: 1.4;
  border-bottom: 1.25px solid rgba(0, 0, 0, 0.05);
}

.import-status-log li:last-child {
  border-bottom: none;
}

.import-status-log .log-time {
  flex: 0 0 auto;
  color: var(--color-muted);
  min-width: 8rem;
}

.import-status-log .log-message {
  flex: 1 1 auto;
  color: var(--color-text);
}

.import-status-log .import-log-error .log-message {
  color: var(--color-danger);
}

.import-status-log .import-log-complete .log-message {
  color: var(--color-success);
}

.import-session-board {
  margin-top: var(--space-4);
  padding: var(--space-2);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(37, 99, 235, 0.04);
  position: relative;
}

.import-session-board[hidden] {
  display: none !important;
}

.import-session-board.is-loading::after {
  content: "Đang cập nhật…";
  position: absolute;
  top: var(--space-2);
  right: var(--space-3);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.import-session-board.is-loading .import-session-table {
  opacity: 0.75;
}

.import-session-board-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.import-session-board-header h4 {
  margin: 0 0 var(--space-2);
}

.import-session-board-header .muted {
  margin: 0;
}

.import-session-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.import-session-board-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.import-session-board-stats dt {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 0.15rem;
}

.import-session-board-stats dd {
  margin: 0;
  font-weight: 600;
  font-size: 1.2rem;
}

.import-session-board-table {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  width: 100%;
  max-height: 400px;
}

.import-routing-chart {
  padding: var(--space-2);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.04);
}

.import-routing-chart[hidden] {
  display: none !important;
}

.import-routing-chart-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.import-routing-chart-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 240px;
}

.import-routing-chart-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.import-routing-chart-header h4 {
  margin: 0 0 var(--space-1);
}

.import-routing-chart-title-row h4 {
  margin: 0;
}

#tab-panel-routing-config > .settings-panel-header .settings-toolbar-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.routing-config-toolbar-action {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 64px;
  min-width: 64px;
}

.routing-config-toolbar-action .ghost-icon-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.12);
  border: 1.25px solid rgba(37, 99, 235, 0.28);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.routing-config-toolbar-action .ghost-icon-button:hover,
.routing-config-toolbar-action .ghost-icon-button:focus-visible {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
  outline: none;
}

.routing-config-toolbar-action-label {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1.15;
  min-height: 0.9rem;
  text-align: center;
  white-space: nowrap;
}

.performance-routing-refresh-button {
  color: var(--color-primary);
}

.performance-routing-refresh-button:disabled {
  opacity: 1;
}

.performance-routing-refresh-button.is-busy {
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.36);
}

.performance-routing-refresh-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.performance-routing-refresh-button.is-busy svg {
  animation: button-spin 0.75s linear infinite;
}

.performance-routing-refresh-status {
  min-width: 0;
}

.import-routing-chart-heading p {
  margin: 0;
}

.import-routing-chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.import-routing-chart-legend-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.import-routing-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.import-routing-chart-legend-swatch {
  width: 14px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.import-routing-chart-legend-swatch.is-base {
  background: rgba(37, 99, 235, 0.45);
}

.import-routing-chart-legend-swatch.is-new {
  background: rgba(34, 197, 94, 0.45);
}

.import-routing-chart-legend-swatch.is-auto {
  background: rgba(34, 197, 94, 0.45);
}

.import-routing-chart-legend-swatch.is-manual {
  background-color: rgba(34, 197, 94, 0.45);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.7) 0,
    rgba(255, 255, 255, 0.7) 2px,
    transparent 2px,
    transparent 6px
  );
}

.import-routing-chart-groups {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.import-routing-chart-group-chip {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.15s ease;
}

.import-routing-chart-group-chip.is-hidden {
  opacity: 0.55;
  text-decoration: line-through;
  border-style: dashed;
}

.import-routing-chart-group-chip:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.import-routing-chart-body {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.import-routing-chart-main {
  position: relative;
  width: 100%;
  height: 260px;
  padding-bottom: var(--space-2);
}

.import-routing-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.import-routing-leave-tooltip {
  position: absolute;
  z-index: 8;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  font-size: 0.74rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.import-routing-leave-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.import-routing-leave-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(15, 23, 42, 0.95);
}

.routing-simulation-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.7);
  margin-top: var(--space-4);
  margin-bottom: 0;
}

.routing-simulation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.routing-simulation-title {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}

.routing-simulation-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-2);
}

.routing-simulation-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.routing-simulation-fields input {
  width: 100%;
}

.routing-simulation-note {
  margin: 0;
}

.import-routing-score-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.import-routing-score-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.import-routing-score-chart-header h5 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.import-routing-score-legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.import-routing-score-toggle {
  margin-left: auto;
  padding: 0.15rem 0.3rem;
}

.import-routing-score-toggle .vtiger-preview-mode-label {
  font-size: 0.78rem;
}

.import-routing-score-toggle .vtiger-preview-mode-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.import-routing-score-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.import-routing-score-legend-swatch {
  width: 12px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.import-routing-score-legend-swatch.is-load {
  background: rgba(37, 99, 235, 0.45);
}

.import-routing-score-legend-swatch.is-sla {
  background: rgba(14, 116, 144, 0.45);
}

.import-routing-score-legend-swatch.is-skill {
  background: rgba(249, 115, 22, 0.45);
}

.import-routing-score-legend-swatch.is-penalty {
  background-color: rgba(239, 68, 68, 0.45);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.7) 0,
    rgba(255, 255, 255, 0.7) 2px,
    transparent 2px,
    transparent 6px
  );
}

.import-routing-score-legend-swatch.is-current {
  background: rgba(37, 99, 235, 0.45);
}

.import-routing-score-legend-swatch.is-reservation {
  background-color: rgba(37, 99, 235, 0.45);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.7) 0,
    rgba(255, 255, 255, 0.7) 2px,
    transparent 2px,
    transparent 6px
  );
}

.import-routing-score-chart-body {
  position: relative;
  width: 100%;
  height: 200px;
}

.import-routing-score-chart-header {
  cursor: pointer;
  user-select: none;
}

.import-routing-score-chart.is-collapsed .import-routing-score-chart-body {
  display: none;
}

.import-routing-score-chart.is-collapsed .import-routing-score-legend {
  display: none;
}

.import-routing-score-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.import-routing-score-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2);
}

.import-routing-chart-popover {
  position: fixed;
  min-width: 360px;
  max-width: min(90vw, 720px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  z-index: 20;
}

.import-routing-chart-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.import-routing-chart-popover-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.import-routing-chart-popover-title {
  font-weight: 600;
  color: var(--color-heading);
}

.import-routing-chart-popover-sub {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.import-routing-chart-popover-body {
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-2);
}

.import-routing-chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.import-routing-chart-table th,
.import-routing-chart-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: top;
  word-break: break-word;
}

.import-routing-chart-table th {
  position: sticky;
  top: 0;
  background: #fff;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.import-routing-row-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: underline;
}

.import-routing-row-link:hover,
.import-routing-row-link:focus-visible {
  color: #1d4ed8;
}

.import-routing-chart-empty {
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--color-border-subtle);
  text-align: center;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

/* Giữ yêu cầu hiển thị ~2 dòng và cuộn: chuyển cuộn sang tbody để dropdown không bị cắt */
.import-session-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;
  border-spacing: 0;
}

.import-session-table thead {
  display: table-header-group;
}

.import-session-table tbody {
  display: table-row-group;
}

.import-session-table th,
.import-session-table td {
  padding: 10px;
  line-height: 1.4;
  vertical-align: middle;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
  text-align: center;
  border-bottom: 1.25px solid rgba(0, 0, 0, 0.05);
}

.import-session-table .cell-name,
.import-session-table th.cell-name {
  width: 200px;
}
.import-session-table .cell-status-progress,
.import-session-table th.cell-status-progress {
  width: 192px;
  text-align: center;
}
.import-session-table .cell-issues,
.import-session-table th.cell-issues {
  width: 120px;
  text-align: center;
}
.import-session-table .cell-file,
.import-session-table th.cell-file {
  width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.import-session-table .cell-updated,
.import-session-table th.cell-updated {
  width: 170px;
  white-space: nowrap;
}
.import-session-table .cell-actions,
.import-session-table th.cell-actions {
  width: 70px;
  text-align: center;
}

.import-session-table .cell-name a {
  display: block;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-session-table tbody tr.is-current-session {
  background: rgba(37, 99, 235, 0.08);
}

.import-session-table tbody tr.is-failed-session {
  background: rgba(220, 38, 38, 0.08);
}

.import-session-table tbody tr.is-cancel-requested {
  background: rgba(251, 191, 36, 0.08);
}

.import-session-table tbody tr:last-child td {
  border-bottom: none;
}

.import-session-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.import-session-type-pill.is-standard {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
}

.import-session-type-pill.is-vtiger {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success-strong);
}

.import-actions {
  white-space: nowrap;
  text-align: center;
}

.import-session-action-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  overflow: visible;
}

.import-session-actions-trigger {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.import-session-actions-trigger:hover,
.import-session-actions-trigger:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.import-session-actions-trigger:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.import-session-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 11rem;
  background: var(--color-surface-app);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.15);
  padding: var(--space-2);
  display: none;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 1000;
}

.import-session-action-menu:is(:hover, :focus-within) .import-session-actions-menu {
  display: flex;
}

.import-session-actions-menu button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  margin-bottom: var(--space-1);
}

.import-session-actions-menu button:last-child {
  margin-bottom: 0;
}

.compact-button {
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  min-height: 2.1rem;
}

.import-session-progress {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin: 0 auto 0.35rem;
  max-width: 200px;
  display: flex;
  align-items: center;
}

.import-session-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(135deg, #22c55e, #2563eb);
  transition: width 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.import-session-progress-label {
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
}

.import-session-progress-note {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.status-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.82rem;
}
.status-progress-header .status-text {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}
.status-progress-header .status-note {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.ghost-button {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  background: transparent;
  border: 1.25px solid rgba(0, 0, 0, 0.2);
  color: var(--color-text);
}

.ghost-button:hover,
.ghost-button:focus {
  background: rgba(0, 0, 0, 0.05);
}

@keyframes import-dot-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  70% {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.import-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.import-step.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.import-step.is-completed {
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--color-success);
}

.import-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  color: inherit;
  font-weight: var(--font-weight-semibold);
}

.import-step.is-completed .import-step-index {
  background: rgba(34, 197, 94, 0.15);
}

.import-step-panels {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: 8px;
  display: flex;  
  flex-direction: column;
  gap: var(--space-4);
}

.import-step-panel {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
}

.import-step-panel.is-active {
  display: flex;
}

.import-guideline-list {
  margin-top: 16px;
  padding-left: var(--space-5);
  color: var(--color-text-muted);
  display: grid;
  gap: var(--space-2);
}

.import-guideline-list code {
  font-size: 0.95rem;
}

.import-upload-field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.import-dropzone {
  justify-content: center;
  flex-direction: column;
  width: 100%;
  min-height: 120px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  background: var(--color-surface);
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  position: relative;
}

.import-dropzone:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.import-dropzone .import-dropzone-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
}

.import-dropzone-hint {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.import-dropzone.is-dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: 0 6px 22px rgba(28, 103, 255, 0.15);
}

.import-checklist {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-height: 700px;
  overflow-y: auto;
  padding-right: var(--space-2);
}

.import-checklist-alert {
  position: relative;
  margin-left: auto;
}

.import-checklist-alert summary {
  list-style: none;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}

.import-checklist-alert summary::-webkit-details-marker {
  display: none;
}

.import-checklist-alert .alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fcd34d;
  color: #8a5300;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  border: 1px solid #f3b41b;
  line-height: 1;
}

.import-checklist-alert[open] .alert-icon {
  box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.4);
}

.import-checklist-popover {
  position: absolute;
  right: 0;
  top: 36px;
  min-width: 400px;
  max-width: 620px;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 4;
}

.import-issues-popover {
  max-height: 320px;
  overflow: auto;
  min-width: 400px;
}

.import-issues-popover .import-issue-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.import-checklist-popover .popover-title {
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--color-text-strong);
}

.import-checklist-popover ul {
  margin: 0;
  padding-left: 18px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  display: grid;
  gap: 6px;
}

.import-classification-summary {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.import-classification-chip {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--color-surface-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.import-classification-chip span {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.import-classification-chip strong {
  font-size: 1.4rem;
  color: var(--color-heading);
}

.import-issue-list {
  margin: 0;
  padding-left: var(--space-4);
  display: grid;
  gap: var(--space-2);
}

.import-issue-list li {
  font-size: 0.95rem;
}

.import-issue-list .import-issue-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.import-issue-list .import-issue-link:hover,
.import-issue-list .import-issue-link:focus {
  text-decoration: underline;
}

.import-issue-list .import-issue-link:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
}

.import-issue--error {
  color: var(--color-danger);
}

.import-issue--warning {
  color: var(--color-warning);
}

.import-issue--success {
  color: var(--color-success);
}

.import-preview-table td,
.import-preview-table th {
  white-space: normal;
}

.import-preview-table td {
  vertical-align: middle;
}

.import-preview-spacer td {
  padding: 0 !important;
  border: none !important;
}

.import-preview-table th {
  min-width: 240px;
}

/* Thu gọn bảng import luồng hồ sơ để khớp dữ liệu thực tế */
.group-import-modal .import-preview-table {
  min-width: unset;
  table-layout: auto;
}

.group-import-modal .import-preview-table th:first-child,
.group-import-modal .import-preview-table td:first-child {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.group-import-modal .import-preview-table th:nth-child(2),
.group-import-modal .import-preview-table td:nth-child(2) {
  width: 110px;
  min-width: 110px;
}

.group-import-modal .import-preview-table th:nth-child(3),
.group-import-modal .import-preview-table td:nth-child(3) {
  min-width: 120px;
}

.group-import-modal .import-preview-table th:nth-child(4),
.group-import-modal .import-preview-table td:nth-child(4) {
  min-width: 160px;
}

.group-import-modal .import-preview-table th:nth-child(5),
.group-import-modal .import-preview-table td:nth-child(5) {
  min-width: 200px;
}

.group-import-modal .import-preview-table th:nth-child(6),
.group-import-modal .import-preview-table td:nth-child(6) {
  min-width: 140px;
}

.group-import-modal .import-preview-table th:nth-child(7),
.group-import-modal .import-preview-table td:nth-child(7) {
  min-width: 220px;
}

.group-import-modal .import-preview-table th:nth-child(8),
.group-import-modal .import-preview-table td:nth-child(8) {
  min-width: 220px;
}

.import-table-small th,
.import-table-small td {
  font-size: 0.85rem;
  line-height: 1.35;
  text-align: left;
  border: 1.25px solid var(--color-border-strong);
  padding: var(--space-2) var(--space-2);
}

.import-table-small td {
  padding-top: calc(var(--space-1) + 2px);
  padding-bottom: calc(var(--space-1) + 2px);
}

.import-header-label {
  display: block;
  font-weight: var(--font-weight-semibold);
}

.import-header-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}

.import-header-desc-row th {
  background: var(--color-surface-muted);
  border-top: none;
}

.import-cell-missing {
  background: rgba(250, 204, 21, 0.16);
}

.import-cell-warning {
  background: rgba(37, 99, 235, 0.12);
}

.import-edit-input {
  width: 100%;
  min-width: 140px;
}

.import-step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.import-step-actions-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.import-next-button-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.import-next-button-wrap .primary-button:disabled {
  pointer-events: none;
}

.import-next-button-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 300px;
  max-width: 420px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  pointer-events: none;
  z-index: 8;
}

.import-next-button-wrap[data-disabled-reason]:hover .import-next-button-tooltip,
.import-next-button-wrap[data-disabled-reason]:focus-within .import-next-button-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.import-next-button-tooltip::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: rgba(15, 23, 42, 0.96);
}

.import-next-button-tooltip-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fecaca;
}

.import-next-button-tooltip-reason,
.import-next-button-tooltip-guidance {
  margin: 4px 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.import-next-button-tooltip-guidance {
  color: #cbd5e1;
}

.import-summary {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  background: rgba(37, 99, 235, 0.03);
}

.import-file-summary {
  margin-top: var(--space-3);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  background: var(--color-surface-muted);
}

.import-parsing-overlay {
  margin-top: var(--space-3);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: rgba(15, 23, 42, 0.03);
}

.import-parsing-content {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.import-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--color-primary);
  animation: importSpinner 0.8s linear infinite;
}

@keyframes importSpinner {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.import-guide-table th,
.import-guide-table td {
  white-space: nowrap;
  text-transform: none;
  letter-spacing: normal;
  word-break: normal;
}

.import-guide-table {
  width: max-content;
  min-width: max(100%, 960px);
}

.import-guide-table code {
  font-size: 0.8rem;
}

.import-step-actions .primary-button[hidden] {
  display: none;
}

.import-step-actions .secondary-button[hidden] {
  display: none;
}

.import-preview-table input[type="text"] {
  font-size: 0.85rem;
  padding: var(--space-2) var(--space-3);
}

.import-preview-table thead th {
  text-transform: none;
  letter-spacing: normal;
}

.import-scrollable {
  overflow-x: auto;
}

@media (max-width: 768px) {
  .import-stepper {
    gap: var(--space-2);
  }

  .import-step {
    flex: 1 1 calc(50% - var(--space-2));
    justify-content: center;
  }

  .import-step-panels {
    padding: var(--space-4);
  }

  .import-preview-table td,
  .import-preview-table th {
    white-space: normal;
  }
}

#updateDirectorModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: var(--space-3);
  padding-bottom: var(--space-4);
}

#updateSpecialistModal .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: var(--space-1);
  padding-bottom: var(--space-4);
}

#updateSpecialistModal .modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-end;
}

#updateSpecialistModal .modal-actions button {
  flex: 0 0 auto;
  min-width: 140px;
}

.table-actions {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.admin-account-actions {
  gap: var(--space-2);
  flex-wrap: wrap;
}

.admin-account-name-input {
  min-width: 180px;
  max-width: 100%;
}

.table-action-menu {
  position: relative;
  display: inline-flex;
}

.action-menu-button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
}

.action-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  padding: var(--space-1);
  z-index: 5;
  display: flex;
  flex-direction: column;
}

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

.action-menu-item {
  border: none;
  background: transparent;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  cursor: pointer;
  color: inherit;
}

.action-menu-item:hover,
.action-menu-item:focus-visible {
  background: rgba(148, 163, 184, 0.18);
}

.action-menu-item--danger {
  color: var(--color-danger);
}

.action-menu-item:disabled,
.action-menu-item[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.specialist-actions-col {
  width: 120px;
  min-width: 60px;
  text-align: center;
}
body.modal-open {
  overflow: hidden;
}

body.modal-open.preview-modal-passive {
  overflow: auto;
  overscroll-behavior: auto;
}

.modal.modal-stack-top {
  z-index: 9998;
}

body.modal-open .modal.modal-stack-top {
  z-index: 9998;
}

#actionModal.modal-stack-top {
  z-index: 10020;
}

body.modal-open #actionModal.modal-stack-top {
  z-index: 10020;
}

.modal-dialog {
  position: relative;
  width: min(800px, 95vw);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.25) transparent;
  background: var(--color-surface);
  background-clip: padding-box;
  -webkit-background-clip: padding-box;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border-strong);
  padding: var(--space-2);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-dialog,
.confirm-modal-dialog {
  --modal-frame-border-color: rgba(71, 85, 105, 0.6);
  --modal-frame-ring-color: transparent;
  --modal-frame-inner-color: rgba(255, 255, 255, 0.72);
  --modal-frame-shadow: 0 24px 56px rgba(15, 23, 42, 0.16);
  border: 1px solid var(--modal-frame-border-color);
  box-shadow: var(--modal-frame-shadow);
}

.modal-dialog::after {
  inset: 1px;
  box-shadow: inset 0 0 0 1px var(--modal-frame-inner-color);
}

.modal-dialog.attachments-window-dialog,
.modal-dialog.modal-workflow-dialog,
.modal-dialog.modal-form-dialog {
  --modal-frame-border-color: rgba(71, 85, 105, 0.62);
  --modal-frame-ring-color: transparent;
  --modal-frame-inner-color: rgba(255, 255, 255, 0.82);
}

.modal-dialog.attachments-preview-dialog--compact {
  --modal-frame-border-color: rgba(71, 85, 105, 0.66);
  --modal-frame-inner-color: rgba(255, 255, 255, 0.82);
  border-color: var(--modal-frame-border-color);
  box-shadow: var(--modal-frame-shadow);
}

.confirm-modal-dialog {
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.16);
}

.summary-inline {
  margin: 0;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  border: 1.25px solid var(--color-border);
  background: var(--color-surface-subtle);
  font-weight: var(--font-weight-semibold);
}

.summary-inline-total {
  color: var(--color-text);
}

.summary-inline-online {
  color: #16a34a;
}

.summary-inline-offline {
  color: #fb923c;
}
.handoff-distribution-mode-switch {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full, 999px);
  background: rgba(148, 163, 184, 0.12);
  width: fit-content;
}

.handoff-mode-label {
  font-weight: 600;
  color: rgba(15, 23, 42, 0.6);
  transition: color 0.2s ease;
}

.handoff-mode-label[data-active="true"] {
  color: var(--color-text, #0f172a);
}
:root {
.data-load-settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1195;
}

.data-load-settings-popover {
  position: fixed;
  width: 420px;
  max-height: 660px;
  padding: var(--space-5);
  background: var(--surface-elevated, #fff);
  border: 1.25px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  z-index: 1200;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.data-load-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1.25px solid rgba(15, 23, 42, 0.06);
}

.data-load-intro-text h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--color-heading, #0f172a);
}

.data-load-intro-text p {
  margin: var(--space-2) 0 0;
  color: var(--gray-600);
  font-size: 0.9rem;
}

.data-load-status-pill {
  align-self: flex-start;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: rgb(14, 165, 233);
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.data-load-status-pill[data-mode="mixed"] {
  background: rgba(79, 70, 229, 0.12);
  color: rgb(79, 70, 229);
  border-color: rgba(79, 70, 229, 0.25);
}

.data-load-settings-form .settings-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.data-load-settings-form .settings-fieldset + .settings-fieldset {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1.25px solid var(--gray-100);
}

.data-load-settings-form .settings-fieldset.is-disabled {
  display: none;
}

.data-load-settings-form .settings-legend {
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
  color: var(--gray-700);
}

.data-load-settings-form .settings-legend.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  margin-bottom: var(--space-2);
}

.data-load-settings-form .settings-legend.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-primary);
}

.data-load-toggle {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
}

.data-load-toggle .toggle-switch-track {
  flex-shrink: 0;
}

.data-load-toggle .toggle-switch-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-top: 0;
  flex: 1 1 auto;
  min-width: 0;
  word-break: normal;
}

.data-load-toggle .toggle-switch-label strong,
.data-load-toggle .toggle-switch-label small {
  display: block;
}

.data-load-toggle .toggle-switch-label small {
  font-size: 0.75rem;
  color: var(--gray-500);
  display: block;
  line-height: 1.35;
}

.data-load-settings-form .settings-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.data-load-settings-form .settings-label {
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  color: var(--gray-700);
}

.data-load-settings-form .radio-inline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
}

.data-load-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.data-load-settings-actions-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.docx-proofread-dict-admin {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

.docx-proofread-dict-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: var(--space-5);
  align-items: start;
  min-width: 0;
}

.docx-proofread-dict-section {
  min-width: 0;
}

.docx-proofread-dict-section--import {
  border-right: 1px solid var(--color-border-subtle);
  padding-right: var(--space-5);
}

.docx-proofread-dict-section-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.docx-proofread-dict-section-header h4,
.docx-proofread-dict-terms-header h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--gray-900);
}

.docx-proofread-dict-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.docx-proofread-dict-source-row,
.docx-proofread-dict-publish-row,
.docx-proofread-dict-form-grid {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.docx-proofread-dict-source-row {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
}

.docx-proofread-dict-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docx-proofread-dict-publish-row {
  grid-template-columns: minmax(180px, 0.7fr) minmax(170px, 0.65fr) minmax(220px, 1fr);
}

.docx-proofread-dict-field,
.docx-proofread-dict-source-row label,
.docx-proofread-dict-publish-row label,
.docx-proofread-dict-form-grid label,
.docx-proofread-dict-term-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  color: var(--gray-700);
}

.docx-proofread-dict-field > span,
.docx-proofread-dict-source-row label > span,
.docx-proofread-dict-publish-row label > span,
.docx-proofread-dict-form-grid label > span,
.docx-proofread-dict-term-form label > span {
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.docx-proofread-dict-field small,
.docx-proofread-dict-form-grid label small {
  line-height: 1.35;
}

.docx-proofread-dict-field--file input[type="file"] {
  min-height: 38px;
}

.docx-proofread-dict-form-grid input,
.docx-proofread-dict-form-grid select,
.docx-proofread-dict-form-grid textarea,
.docx-proofread-dict-source-row input,
.docx-proofread-dict-publish-row input,
.docx-proofread-dict-publish-row select,
.docx-proofread-dict-field textarea,
.docx-proofread-dict-term-form input,
.docx-proofread-dict-term-form select {
  width: 100%;
  min-width: 0;
}

.docx-proofread-dict-field textarea {
  resize: vertical;
  min-height: 120px;
}

.docx-proofread-dict-options,
.docx-proofread-dict-actions,
.docx-proofread-dict-terms-header,
.docx-proofread-dict-terms-actions,
.docx-proofread-dict-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.docx-proofread-dict-actions {
  justify-content: space-between;
}

.docx-proofread-dict-actions .system-config-status {
  flex: 1 1 260px;
  margin: 0;
  min-width: 0;
}

.docx-proofread-dict-options label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 3px 0;
  font-size: 0.85rem;
  color: var(--gray-700);
  white-space: nowrap;
}

.docx-proofread-dict-result {
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  padding: var(--space-3);
  background: var(--gray-50);
}

.docx-proofread-dict-result-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px var(--space-3);
  font-size: 0.82rem;
}

.docx-proofread-dict-result-grid code {
  overflow-wrap: anywhere;
}

.docx-proofread-dict-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-2);
}

.docx-proofread-dict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.docx-proofread-dict-table th,
.docx-proofread-dict-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
  vertical-align: top;
}

.docx-proofread-dict-table th {
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  white-space: nowrap;
}

.docx-proofread-dict-version-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.docx-proofread-dict-terms {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-4);
}

.docx-proofread-dict-terms-header {
  justify-content: space-between;
  align-items: flex-start;
}

.docx-proofread-dict-terms-actions .text-input {
  width: min(260px, 100%);
}

.docx-proofread-dict-term-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.2fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) minmax(220px, 1fr) auto;
  gap: var(--space-3);
  align-items: end;
}

.docx-proofread-dict-term-form > * {
  min-width: 0;
}

@media (max-width: 1180px) {
  .docx-proofread-dict-workbench {
    grid-template-columns: 1fr;
  }

  .docx-proofread-dict-section--import {
    border-right: 0;
    border-bottom: 1px solid var(--color-border-subtle);
    padding-right: 0;
    padding-bottom: var(--space-4);
  }

  .docx-proofread-dict-source-row,
  .docx-proofread-dict-publish-row {
    grid-template-columns: 1fr 1fr;
  }

  .docx-proofread-dict-publish-row .docx-proofread-dict-field--scope {
    grid-column: 1 / -1;
  }

  .docx-proofread-dict-term-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docx-proofread-dict-term-form button {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .docx-proofread-dict-form-grid,
  .docx-proofread-dict-source-row,
  .docx-proofread-dict-publish-row,
  .docx-proofread-dict-term-form {
    grid-template-columns: 1fr;
  }
}

.priority-ranking-section > h3 {
  margin-bottom: var(--space-4);
}
.priority-component-tooltip {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -10px);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1.25px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  color: var(--color-text);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  min-width: 200px;
  max-width: 320px;
  white-space: pre-line;
  word-break: normal;
  text-align: left;
}

.priority-component-tooltip.is-visible {
  opacity: 1;
}

.priority-component-tooltip::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--color-surface);
  border-left: 1.25px solid var(--color-border);
  border-top: 1.25px solid var(--color-border);
  transform: rotate(45deg);
  bottom: -6px;
  left: 50%;
  margin-left: -6px;
}

.priority-component-tooltip.is-flipped {
  top: 100%;
  bottom: auto;
  transform: translate(-50%, 10px);
}

.priority-component-tooltip.is-flipped::after {
  bottom: auto;
  top: -6px;
  border-left: none;
  border-top: none;
  border-right: 1.25px solid var(--color-border);
  border-bottom: 1.25px solid var(--color-border);
}
.audit-console-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1.25px solid var(--color-border-subtle);
}

.audit-console-setting-row:last-child {
  border-bottom: none;
}

.audit-console-setting-label {
  flex: 1;
}

.audit-console-setting-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.audit-console-setting-field input,
.audit-console-setting-field select {
  width: 100%;
}

.audit-console-storage-range-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.audit-console-inline-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.audit-console-inline-field span {
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
}

.audit-console-setting-label[data-tooltip] {
  position: relative;
  cursor: help;
}

.audit-console-setting-label[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 0;
  white-space: normal;
  min-width: 240px;
  max-width: 320px;
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.8rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 25;
}

.audit-console-setting-label[data-tooltip]:hover::after,
.audit-console-setting-label[data-tooltip]:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

.audit-console-setting-label .tiny-text {
  margin-top: 0.15rem;
}

.audit-console-settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-3);
}
.import-step-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.import-step-panel-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.import-step-panel-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.import-suggestion-source {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.import-suggestion-source select {
  height: 32px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #d6d9e0;
  background: #fff;
}

.import-step-panel-header h4 {
  margin: 0;
}

.vtiger-preview-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.2rem 0.35rem;
  border-radius: 999px;
}

.vtiger-preview-mode-label {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: var(--font-weight-medium);
}

.vtiger-preview-mode-buttons {
  display: inline-flex;
  gap: 0.2rem;
  background: #fff;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.15rem;
}

.vtiger-preview-mode-btn {
  border: none;
  background: transparent;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.vtiger-preview-mode-btn[aria-pressed="true"] {
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
}

.vtiger-preview-mode-btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.ghost-icon-button#assignmentImportDownloadTemplateButton,
.import-step-panel-header .ghost-icon-button {
  font-size: 1.3rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.import-guidance-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.import-guidance-tooltip {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  width: min(420px, 90vw);
  min-width: 240px;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 30;
  text-align: left;
}

.import-guidance-wrapper:hover .import-guidance-tooltip,
.import-guidance-wrapper:focus-within .import-guidance-tooltip {
  display: flex;
}

.import-guidance-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 1.5rem;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #fff transparent;
  filter: drop-shadow(0 -1px 1px rgba(15, 23, 42, 0.15));
}

.tooltip-title {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.tooltip-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tooltip-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  border: 1.25px solid rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
}

.tooltip-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.handover-wizard {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--color-surface-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.handover-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}

.handover-step-indicator {
  flex: 1;
  min-width: min(240px, 100%);
  border: 1.25px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  background: rgba(15, 23, 42, 0.02);
  transition: border-color var(--transition-base), color var(--transition-base),
    background var(--transition-base), box-shadow var(--transition-base);
}

.handover-step-indicator.is-active {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--color-heading);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.1);
}

.handover-step-indicator.is-completed {
  border-style: solid;
  border-color: rgba(22, 163, 74, 0.4);
  background: rgba(22, 163, 74, 0.08);
  color: var(--color-success-hover);
}

.handover-step-index {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1.25px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  font-size: 1.1rem;
}

.handover-step-title {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  color: inherit;
}

.handover-step-desc {
  margin: 0;
  font-size: 0.85rem;
}

.handover-step-panel {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  background: var(--color-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.handover-step-panel-header p {
  margin-top: var(--space-2);
}

.handover-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.handover-role-card {
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: rgba(15, 23, 42, 0.02);
  cursor: pointer;
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    background var(--transition-base);
}

.handover-role-card input {
  accent-color: var(--color-primary);
}

.handover-role-card:hover,
.handover-role-card:focus-within {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
  background: rgba(37, 99, 235, 0.06);
}

.handover-role-title {
  font-weight: var(--font-weight-semibold);
  font-size: 1rem;
  color: var(--color-heading);
}

.handover-role-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.handover-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.handover-warning {
  border: 1.25px solid rgba(244, 114, 182, 0.3);
  background: rgba(244, 114, 182, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  color: var(--color-heading);
  font-size: 0.95rem;
}

.handover-warning.inline {
  margin-top: 0;
}

.handover-step-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
}

.handover-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.02);
}

.handover-summary-column {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.handover-summary-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.handover-summary-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.handover-summary-meta {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.handover-impact {
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
  padding: var(--space-4);
  background: rgba(15, 23, 42, 0.02);
}

.handover-impact h5 {
  margin: 0 0 var(--space-2);
}

.handover-impact ul {
  margin: 0;
  padding-left: var(--space-5);
  color: var(--color-text-muted);
}

.handover-status {
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1.25px solid transparent;
  font-weight: var(--font-weight-medium);
}

.handover-status.is-info {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
}

.handover-status.is-error {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
  color: var(--color-danger);
}

.handover-status.is-success {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.08);
  color: var(--color-success);
}

.handover-result-card {
  border: 1.25px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.handover-result-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.handover-result-list dt {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.handover-result-list dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.subtle-button {
  border: 1.25px dashed var(--color-border);
  background: transparent;
  color: var(--color-text);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: border-color var(--transition-base), color var(--transition-base),
    background var(--transition-base), box-shadow var(--transition-base);
}

.subtle-button:hover,
.subtle-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.snapshot-controls {
  position: sticky;
  top: var(--snapshot-controls-offset, 72px);
  z-index: 9998;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 20px;
  row-gap: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: var(--surface-card, #fff);
  border: 1px solid var(--surface-border, #e4e7ec);
  border-radius: 14px;
  box-shadow: var(--elevation-low, 0 1px 3px rgba(15, 23, 42, 0.08));
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: visible;
}

.snapshot-controls.is-stuck {
  box-shadow: var(--elevation-medium, 0 4px 20px rgba(15, 23, 42, 0.12));
  backdrop-filter: blur(8px);
  border-color: var(--surface-border-strong, #cfd4dc);
}

.snapshot-controls__title {
  flex: 1 1 auto;
  min-width: 220px;
}

.snapshot-controls__title h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.snapshot-controls__title p {
  margin: 4px 0 0;
  color: var(--text-muted, #667085);
  font-size: 0.9rem;
}

.snapshot-controls__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 240px;
}

.snapshot-controls[data-context="performance"] .performance-header-left {
  flex: 1 1 320px;
  min-width: 240px;
}

.snapshot-controls .period-control-field {
  margin: 0;
}

.snapshot-refresh-wrapper {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.snapshot-refresh-wrapper .snapshot-refresh-button {
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .snapshot-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .snapshot-controls__actions {
  justify-content: space-between;
  }

  .snapshot-controls[data-context="performance"] .performance-header-left {
    width: 100%;
  }
}

/* Only make the actions stick for Performance; keep chips static */
.snapshot-controls[data-context="performance"] {
  position: static;
}

.snapshot-controls[data-context="performance"] .snapshot-controls__actions {
  position: sticky;
  top: var(--snapshot-controls-offset, 72px);
  z-index: 9999;
  background: var(--surface-card, #fff);
  border-radius: 12px;
  padding: 6px 8px;
  overflow: visible;
}

.performance-period-inline {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  width: 100%;
  text-align: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.performance-period-inline .summary-period-control {
  margin: 0;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  align-self: center;
}

.performance-period-inline--sidebar {
  padding: 0 12px;
  box-sizing: border-box;
  margin-bottom: 8px;
  position: relative;
}


.settings-hub.is-sidebar-collapsed .performance-period-inline {
  display: none;
}

.performance-period-inline--sidebar .summary-period-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 360px;
  z-index: 10;
}
}

.chat-panel-trigger {
  position: relative;
}

.chat-panel-trigger svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-panel-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-surface);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-panel-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 80;
}

.chat-panel {
  position: fixed;
  top: clamp(72px, 10vh, 132px);
  right: clamp(12px, 4vw, 28px);
  bottom: clamp(16px, 6vh, 32px);
  width: min(420px, calc(100vw - 24px));
  z-index: 90;
  display: flex;
}

body.chat-panel-pinned.app-logged-in {
  --chat-panel-pinned-width: min(420px, 36vw);
  padding-right: calc(var(--chat-panel-pinned-width) + 24px);
  transition: padding-right var(--transition-base);
}

body.chat-panel-pinned .chat-panel-backdrop {
  display: none;
}

body.chat-panel-pinned .chat-panel {
  top: 32px;
  bottom: 32px;
  right: 12px;
  width: var(--chat-panel-pinned-width, 420px);
}

.chat-panel-card {
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-xxl);
  border: 1.25px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--color-border);
}

.chat-panel-header h3 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
}

.chat-panel-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.chat-panel-actions .ghost-icon-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  padding: 0;
}

.chat-panel-actions .ghost-icon-button:hover,
.chat-panel-actions .ghost-icon-button:focus-visible {
  background: rgba(148, 163, 184, 0.2);
  color: #0f172a;
}

.chat-panel-actions .ghost-icon-button[aria-pressed="true"] {
  background: rgba(37, 99, 235, 0.16);
  color: #1d4ed8;
}

.chat-panel-actions .ghost-icon-button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.chat-panel-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
}

.chat-panel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.chat-panel-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border: none;
  border-radius: 999px;
  background: #f1f5f9;
  padding: 8px 14px;
  min-height: 44px;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.chat-panel-search svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--color-text-muted);
}

.chat-panel-search .search-input {
  border: none;
  background: transparent;
  padding: 4px 0 4px 2px;
  width: 100%;
  font: inherit;
  font-size: 0.98rem;
  outline: none;
  box-shadow: none;
}

.chat-panel-search .search-input:focus {
  outline: none;
}

.chat-panel-search:focus-within {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.chat-panel-filters {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-top: 8px;
  padding-bottom: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-panel-filters::-webkit-scrollbar {
  display: none;
}

.chat-filter-chip {
  border: 1px solid transparent;
  background: transparent;
  color: #1f2937;
  padding: 6px 14px;
  min-height: 36px;
  border-radius: 999px;
  font-weight: var(--font-weight-semibold);
  font-size: 0.9rem;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.chat-filter-chip:hover,
.chat-filter-chip:focus-visible {
  border-color: #e2e8f0;
  color: #0f172a;
  outline: none;
}

.chat-filter-chip.is-active {
  background: #e0edff;
  color: #2563eb;
  border-color: #bcd6ff;
}

.chat-panel-list-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 2px;
  font-size: 0.9rem;
  color: #64748b;
}

.chat-panel-list-count {
  font-weight: 700;
  color: #0f172a;
}

.chat-create-panel {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-create-fields {
  display: grid;
  gap: 8px;
}

.chat-create-recipient-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.chat-create-label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding-top: 6px;
  min-width: 42px;
}

.chat-create-recipient-input {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-radius: var(--radius-xl);
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 6px 8px;
}

.chat-create-search-icon {
  width: 18px;
  height: 18px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-create-search-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.chat-create-recipient-input:focus-within {
  outline: none;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.chat-create-search {
  border: none;
  background: transparent;
  font-size: 0.95rem;
  padding: 4px 2px;
  min-width: 240px;
  flex: 1;
}

.chat-create-search:focus {
  outline: none;
}

.chat-create-panel .filter-control {
  margin-top: 2px;
}

.chat-create-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.chat-create-suggestions {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 380px;
  overflow-y: auto;
}

.chat-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.chat-suggestion-item.is-selected {
  background: #e0edff;
}

.chat-suggestion-item.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-suggestion-item:hover,
.chat-suggestion-item:focus-visible {
  background: #f1f5f9;
  outline: none;
}

.chat-suggestion-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  overflow: hidden;
  position: relative;
  --presence-size: 10px;
}

.chat-suggestion-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-suggestion-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-suggestion-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-suggestion-uid {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-suggestion-check {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
}

.chat-suggestion-item.is-selected .chat-suggestion-check {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.chat-suggestion-item.is-selected .chat-suggestion-check::after {
  content: "✓";
}

.chat-suggestion-empty {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 6px 8px;
}

.chat-create-panel .filter-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.chat-create-panel .filter-control {
  border-radius: var(--radius-lg)
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.95rem;
  padding: 8px 10px;
}

.chat-create-panel .filter-control:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.chat-conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 6px;
  flex: 1;
  max-height: 100%;
  margin-bottom: 8px;
}

.chat-conversation-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-contact-section {
  gap: 6px;
}

.chat-conversation-virtual {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chat-conversation-virtual-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-conversation-virtual-spacer {
  height: 0;
  flex: 0 0 auto;
}

.chat-conversation-section.is-skeleton {
  gap: 10px;
}

.chat-conversation-skeleton {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--radius-xl);
  background: rgba(226, 232, 240, 0.5);
}

.chat-conversation-skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(148, 163, 184, 0.25), rgba(226, 232, 240, 0.7), rgba(148, 163, 184, 0.25));
  animation: chatSkeletonPulse 1.4s ease-in-out infinite;
}

.chat-conversation-skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-conversation-skeleton-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(148, 163, 184, 0.2), rgba(226, 232, 240, 0.7), rgba(148, 163, 184, 0.2));
  animation: chatSkeletonPulse 1.4s ease-in-out infinite;
}

.chat-conversation-skeleton-line.is-wide {
  width: 70%;
}

.chat-conversation-skeleton-line.is-medium {
  width: 55%;
}

.chat-conversation-skeleton-meta {
  width: 24px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(148, 163, 184, 0.2), rgba(226, 232, 240, 0.7), rgba(148, 163, 184, 0.2));
  animation: chatSkeletonPulse 1.4s ease-in-out infinite;
}

@keyframes chatSkeletonPulse {
  0% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.55;
  }
}

.chat-conversation-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #64748b;
  padding: 4px 10px 0;
}

#chatConversationEmpty {
  margin-top: auto;
}

.chat-conversation-item {
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  background: transparent;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  align-items: center;
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.chat-conversation-item:hover,
.chat-conversation-item:focus-visible {
  border-color: var(--color-border);
  background: var(--color-surface-subtle);
  outline: none;
}

.chat-conversation-item.is-active {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: none;
}

.chat-conversation-item.is-unread .chat-conversation-name {
  font-weight: var(--font-weight-semibold);
}

.chat-conversation-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  overflow: hidden;
  position: relative;
  --presence-size: 12px;
}

.chat-conversation-avatar.has-avatar-popover {
  cursor: pointer;
}

.chat-conversation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.presence-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: var(--presence-size, 10px);
  height: var(--presence-size, 10px);
  border-radius: 999px;
  background: #cbd5f5;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.presence-indicator.is-online {
  background: #22c55e;
}

.presence-indicator.is-idle {
  background: #f59e0b;
}

.presence-indicator.is-offline {
  background: #cbd5e1;
}

.presence-indicator.is-dnd {
  background: #ef4444;
}

.chat-conversation-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.chat-conversation-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.02rem;
  color: #0f172a;
}

.chat-conversation-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.chat-conversation-count {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.chat-contact-item.has-existing:not(.is-active) {
  border-color: rgba(191, 219, 254, 0.72);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.92), rgba(239, 246, 255, 0.94));
}

.chat-contact-item .chat-conversation-name {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-contact-role {
  --chat-contact-role-dot: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(59, 130, 246, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.chat-contact-role::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--chat-contact-role-dot);
}

.chat-contact-role[data-role="specialist"] {
  --chat-contact-role-dot: #0f766e;
}

.chat-contact-role[data-role="director"] {
  --chat-contact-role-dot: #d97706;
}

.chat-contact-role[data-role="admin"],
.chat-contact-role[data-role="sadmin"] {
  --chat-contact-role-dot: #475569;
}

.chat-conversation-context {
  font-size: 0.68rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.chat-conversation-context:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.7);
  outline-offset: 2px;
}

.chat-unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.chat-conversation-preview-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-conversation-preview {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-conversation-time {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  margin-left: auto;
}

.chat-conversation-meta-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 16px;
}

.chat-reaction-tool {
  position: absolute;
  top: -6px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.chat-reaction-trigger {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #fff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.chat-reaction-trigger svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-reaction-trigger:hover,
.chat-reaction-trigger:focus-visible {
  color: #1d4ed8;
  outline: none;
}

.chat-reaction-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(var(--reaction-popover-shift-x, 0px)) translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 3;
}

.chat-reaction-tool.is-open .chat-reaction-popover,
.chat-reaction-tool:focus-within .chat-reaction-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(var(--reaction-popover-shift-x, 0px)) translateY(0);
}

.chat-reaction-popover.is-below {
  top: calc(100% + 6px);
  bottom: auto;
}

.chat-reaction-option,
.chat-reaction-badge {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #ffffff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.8rem;
  color: var(--color-text);
  cursor: pointer;
}

.chat-reaction-option {
  padding: 2px 6px;
}

.chat-reaction-option.is-active,
.chat-reaction-badge.is-active {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.12);
}

.chat-reaction-option:focus-visible,
.chat-reaction-badge:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.4);
  outline-offset: 2px;
}

.chat-reaction-emoji {
  font-size: 0.9rem;
}

.chat-reaction-count {
  font-size: 0.7rem;
  font-weight: 600;
}

.chat-sticker-image {
  width: 100px;
  max-width: 70vw;
  height: auto;
  display: block;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.chat-context-menu {
  position: fixed;
  z-index: 2200;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px;
  min-width: 0;
  width: max-content;
  max-width: 220px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.chat-context-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}

.chat-context-menu-item:hover,
.chat-context-menu-item:focus-visible {
  background: #f1f5f9;
  outline: none;
}

.chat-context-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-context-menu-item.is-danger {
  color: #ef4444;
}

.chat-forward-search {
  margin-bottom: var(--space-2);
}

.chat-forward-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-forward-section {
  margin: 6px 0 2px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.chat-forward-item.is-selected {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.chat-composer {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1.25px solid var(--color-border);
}

.chat-composer textarea {
  width: 100%;
  min-height: 64px;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--color-border);
  font-family: inherit;
  resize: vertical;
  background: var(--color-surface);
}

.chat-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.chat-dock {
  position: fixed;
  right: clamp(12px, 3vw, 24px);
  bottom: clamp(12px, 3vh, 24px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  z-index: 2000;
  pointer-events: auto;
  width: auto;
  max-width: calc(100vw - 24px);
  left: auto;
}

body.chat-preview-expanded .chat-dock {
  opacity: 0.15;
  transform: translateY(16px);
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 2200;
}

body.chat-preview-expanded .chat-dock.is-preview-hover {
  opacity: 1;
  transform: translateY(0);
}

body.chat-panel-pinned .chat-dock {
  right: calc(12px + var(--chat-panel-pinned-width, 420px) + 12px);
  max-width: calc(100vw - var(--chat-panel-pinned-width, 420px) - 36px);
}

.chat-dock.is-panel-pinned {
  --chat-dock-pinned-width: min(420px, 36vw);
}

.chat-dock.is-panel-pinned {
  right: calc(12px + var(--chat-dock-pinned-width) + 12px);
  max-width: calc(100vw - var(--chat-dock-pinned-width) - 36px);
}

body > .chat-dock {
  width: auto;
}

.chat-dock,
.chat-dock * {
  pointer-events: auto;
}

.chat-dock-panel {
  --chat-dock-message-max-width: clamp(220px, 76%, 560px);
  --chat-dock-thread-inline-width: 75%;
  --chat-dock-thread-max-width: 680px;
  --chat-dock-meta-max-width: clamp(220px, 70%, 480px);
  width: min(420px, 90vw);
  height: min(640px, 80vh);
  max-height: 640px;
  min-height: 0;
  background: var(--color-surface);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  border: 1px solid transparent;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: visible;
  pointer-events: auto;
  position: relative;
  isolation: isolate;
}

.chat-dock-panel.is-pinned {
  --chat-dock-message-max-width: clamp(250px, 82%, 620px);
  --chat-dock-thread-inline-width: 75%;
  --chat-dock-thread-max-width: 760px;
  --chat-dock-meta-max-width: clamp(240px, 76%, 520px);
  position: fixed;
  top: 32px;
  bottom: 32px;
  right: clamp(12px, 3vw, 24px);
  height: auto;
  max-height: none;
  width: var(--chat-dock-pinned-width, min(420px, 90vw));
  z-index: 2100;
}

.chat-dock-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  pointer-events: none;
  z-index: 2;
}

.chat-dock-resize-handle {
  position: absolute;
  top: 0;
  left: -6px;
  width: 12px;
  height: 100%;
  display: none;
  cursor: col-resize;
  touch-action: none;
  z-index: 1;
}

.chat-dock-resize-handle::after {
  content: "";
  position: absolute;
  top: 18%;
  left: 5px;
  width: 2px;
  height: 64%;
  border-radius: var(--radius-pill);
}

.chat-dock-panel.is-pinned .chat-dock-resize-handle {
  display: block;
}

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

.chat-dock-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 9px;
  border-bottom: 1px solid var(--color-border);
  background: #fff;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
}

.chat-dock-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.chat-dock-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  --presence-size: 10px;
}

.chat-dock-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-dock-title-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.chat-dock-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-dock-title-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.chat-dock-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.chat-dock-assignment-info {
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-dock-assignment-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}

.chat-dock-assignment-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.62rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.chat-dock-assignment-value {
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.chat-dock-context-badge {
  font-size: 0.64rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  cursor: pointer;
}

.chat-dock-context-badge:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.7);
  outline-offset: 2px;
}

.chat-dock-meta {
  font-size: 0.71rem;
  color: #64748b;
  white-space: nowrap;
}

.chat-dock-meta--members-trigger {
  cursor: pointer;
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: -7px;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.chat-dock-meta--members-trigger:hover,
.chat-dock-meta--members-trigger:focus-visible {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.1);
  outline: none;
}

.chat-dock-presence {
  font-size: 0.71rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.chat-dock-presence.is-online {
  color: #16a34a;
}

.chat-dock-presence.is-idle {
  color: #d97706;
}

.chat-dock-presence.is-offline {
  color: #94a3b8;
}

.chat-dock-presence.is-dnd {
  color: #ef4444;
}

.chat-dock-live-state {
  font-size: 0.71rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.chat-dock-live-state.is-typing {
  color: #2563eb;
}

.chat-dock-live-state.is-read {
  color: #16a34a;
}

.chat-dock-live-state.is-ai-responding {
  color: #0284c7;
}

.chat-dock-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chat-dock-actions .ghost-icon-button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #64748b;
  padding: 0;
}

.chat-dock-actions .chat-dock-back {
  width: auto;
  min-width: 0;
  padding: 0 10px;
  gap: 6px;
}

.chat-dock-back-label {
  font-size: 0.78rem;
  font-weight: 600;
}

.chat-dock-overflow {
  position: relative;
}

.chat-dock-overflow.is-open .chat-dock-overflow-toggle {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.chat-dock-overflow-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(220px, 72vw);
  padding: 6px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 7;
}

.chat-dock-overflow-menu > .chat-dock-thread-filter-toggle,
.chat-dock-overflow-menu > .chat-dock-members,
.chat-dock-overflow-menu > .chat-dock-settings {
  width: 100%;
}

.chat-dock-overflow-action {
  width: 100% !important;
  min-height: 36px;
  height: auto !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
  justify-content: flex-start !important;
  gap: 10px;
}

.chat-dock-overflow-action:hover,
.chat-dock-overflow-action:focus-visible {
  background: rgba(148, 163, 184, 0.16);
  color: #0f172a;
  outline: none;
}

.chat-dock-overflow-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.chat-dock-overflow-action .chat-dock-overflow-label {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.chat-dock-overflow-menu .chat-dock-settings-popover {
  top: -6px;
  right: calc(100% + 8px);
}

.chat-dock-actions .ghost-icon-button:hover,
.chat-dock-actions .ghost-icon-button:focus-visible {
  background: rgba(148, 163, 184, 0.2);
  color: #0f172a;
  outline: none;
}

.chat-dock-actions .ghost-icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-dock-files-header-actions .ghost-icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-dock-actions .chat-dock-files-toggle.is-active {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.chat-dock-actions .chat-dock-thread-filter-toggle.is-active {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.chat-dock-overflow-menu .chat-dock-thread-filter-toggle.is-active {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.chat-dock-actions .chat-dock-thread-filter-toggle.is-disabled,
.chat-dock-actions .chat-dock-thread-filter-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #94a3b8;
  background: transparent;
  pointer-events: none;
}

.chat-dock-overflow-menu .chat-dock-thread-filter-toggle.is-disabled,
.chat-dock-overflow-menu .chat-dock-thread-filter-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #94a3b8;
  background: transparent;
  pointer-events: none;
}

.chat-dock-thread-notification-host {
  position: absolute;
  top: calc(var(--chat-dock-header-offset, 54px) + 8px);
  right: 12px;
  width: min(248px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  z-index: 5;
  pointer-events: none;
}

.chat-dock-thread-notification {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  color: #0f172a;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.chat-dock-thread-notification:hover,
.chat-dock-thread-notification:focus-visible {
  border-color: rgba(14, 165, 233, 0.34);
  box-shadow: 0 18px 36px rgba(14, 165, 233, 0.14);
  outline: none;
}

.chat-dock-thread-notification-title-row,
.chat-dock-thread-notification-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.chat-dock-thread-notification-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-dock-thread-notification-time,
.chat-dock-thread-notification-meta {
  font-size: 0.66rem;
  color: #64748b;
}

.chat-dock-thread-notification-time {
  flex-shrink: 0;
}

.chat-dock-thread-notification-snippet {
  font-size: 0.74rem;
  line-height: 1.4;
  color: #334155;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.chat-dock-thread-notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.chat-dock-settings {
  position: relative;
}

.chat-dock-settings.is-open .chat-dock-settings-toggle {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.chat-dock-settings-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(260px, 70vw);
  padding: 10px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 6;
}

.chat-dock-settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-dock-settings-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: #f8fafc;
}

.chat-dock-settings-desc {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.chat-dock-settings-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  align-items: center;
  column-gap: 14px;
  width: 100%;
}

.chat-dock-settings-toggle-row .toggle-switch-label {
  order: 1;
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.chat-dock-settings-toggle-row .toggle-switch-track {
  order: 2;
  justify-self: end;
  margin-left: 0;
}

.chat-dock-settings-toggle-row .chat-dock-settings-desc {
  display: block;
  width: 100%;
  font-weight: 400;
  line-height: 1.35;
}

.chat-dock-settings-row-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
}

.chat-dock-settings-title-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-dock-settings-title-input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid #dbe4f0;
  background: #ffffff;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #0f172a;
}

.chat-dock-settings-title-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.38);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.chat-dock-settings-title-save {
  flex: 0 0 auto;
  min-height: 34px;
  padding-inline: 12px;
}

.chat-dock-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.chat-dock-settings-action {
  flex: 1 1 120px;
  min-height: 34px;
  justify-content: center;
}

.chat-dock-settings-leave {
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.24);
}

.chat-dock-settings.is-pending {
  opacity: 0.65;
}

.chat-dock-members {
  position: relative;
}

.chat-dock-members.is-open .chat-dock-members-toggle {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.chat-dock-members-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 12px;
  width: min(280px, 75vw);
  padding: 10px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 8;
}

.chat-dock-members-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  color: #0f172a;
}

.chat-dock-members-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-dock-members-count {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
}

.chat-dock-members-manage-toggle {
  width: 28px;
  height: 28px;
  border-radius: 10px;
}

.chat-dock-members-manage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: #f8fafc;
}

.chat-dock-members-manage.is-pending {
  opacity: 0.7;
}

.chat-dock-members-manage-search {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #dbe4f0;
  background: #ffffff;
  padding: 7px 12px;
  font-size: 0.78rem;
  color: #0f172a;
}

.chat-dock-members-manage-search:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.38);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.chat-dock-members-manage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.chat-dock-members-manage-empty {
  font-size: 0.76rem;
  color: var(--color-text-muted);
}

.chat-dock-member-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #ffffff;
  padding: 7px 8px;
  text-align: left;
}

.chat-dock-member-picker-item:hover,
.chat-dock-member-picker-item:focus-visible {
  border-color: #dbe4f0;
  background: #f8fbff;
  outline: none;
}

.chat-dock-member-picker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  overflow: hidden;
  flex: 0 0 auto;
}

.chat-dock-member-picker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-dock-member-picker-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}

.chat-dock-member-picker-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-member-picker-meta {
  font-size: 0.7rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-member-picker-action {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  color: #2563eb;
}

.chat-dock-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-dock-members-empty {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.chat-dock-member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: #f8fafc;
}

.chat-dock-member-item.is-inactive {
  background: #f8fafc;
  opacity: 0.82;
}

.chat-dock-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex: 0 0 auto;
  overflow: hidden;
}

.chat-dock-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-dock-member-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.chat-dock-member-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-member-meta {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-member-role {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  white-space: nowrap;
}

.chat-dock-member-role.is-owner {
  background: #fef3c7;
  color: #92400e;
}

.chat-dock-member-role.is-admin {
  background: #e0f2fe;
  color: #075985;
}

.chat-dock-member-right {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.chat-dock-member-state {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  white-space: nowrap;
}

.chat-dock-member-state.is-hidden {
  background: #e0f2fe;
  color: #075985;
}

.chat-dock-member-state.is-left {
  background: #ede9fe;
  color: #6d28d9;
}

.chat-dock-member-state.is-removed {
  background: #fee2e2;
  color: #b91c1c;
}

.chat-dock-member-remove {
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 999px;
  background: rgba(254, 242, 242, 0.92);
  color: #b91c1c;
  padding: 4px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.chat-dock-panel.is-reactions-disabled .chat-reaction-tool {
  display: none;
}

.chat-dock-panel.is-reactions-disabled .chat-reaction-badge {
  pointer-events: none;
}

.chat-dock-files-panel {
  position: absolute;
  inset: 56px 1px 1px 1px;
  background: #fff;
  border-top: 1px solid var(--color-border);
  border-bottom-left-radius: calc(var(--radius-xl) - 1px);
  border-bottom-right-radius: calc(var(--radius-xl) - 1px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  z-index: 4;
}

.chat-dock-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-dock-files-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-dock-files-title {
  font-weight: 600;
  color: #0f172a;
}

.chat-dock-files-layout-btn.is-active {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.chat-dock-files-close {
  width: 28px;
  height: 28px;
  border-radius: 10px;
}

.chat-dock-files-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-dock-files-search {
  display: flex;
  align-items: center;
}

.chat-dock-files-search-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  padding: 6px 12px;
  font-size: 0.8rem;
  background: #f8fafc;
  color: #0f172a;
}

.chat-dock-files-search-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.chat-dock-files-filter {
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #f8fafc;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #475569;
}

.chat-dock-files-filter.is-active {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #1d4ed8;
  font-weight: 600;
}

.chat-dock-files-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.chat-dock-files-panel.is-grid .chat-dock-files-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  align-content: start;
}

.chat-dock-files-loading,
.chat-dock-files-error {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  padding: 20px 0;
}

.chat-dock-files-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  border: none;
  background: transparent;
  text-align: left;
  position: relative;
}

.chat-dock-files-item:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.4);
  outline-offset: 2px;
}

.chat-dock-files-item:hover {
  background: transparent;
}

.chat-dock-files-panel.is-grid .chat-dock-files-item {
  grid-template-columns: 1fr;
  align-items: stretch;
  padding: 10px;
}

.chat-dock-files-panel.is-grid .chat-dock-files-body {
  display: none;
}

.chat-dock-files-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.chat-dock-files-panel.is-grid .chat-dock-files-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
}

.chat-dock-files-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-dock-files-thumb.is-loading {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: attachments-diff-shimmer 1.4s ease-in-out infinite;
}

.chat-dock-files-thumb.is-loading img {
  opacity: 0;
}

.chat-dock-files-icon {
  font-size: 0.85rem;
}

.chat-dock-files-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.chat-dock-files-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-files-panel.is-grid .chat-dock-files-name {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-dock-files-sender {
  font-size: 0.74rem;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-files-meta {
  font-size: 0.75rem;
  color: #64748b;
}

.chat-dock-files-panel:not(.is-grid) .chat-dock-files-meta {
  display: none;
}

.chat-dock-files-meta-inline {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
}

.chat-dock-files-panel.is-grid .chat-dock-files-meta-inline {
  display: none;
}

.chat-dock-files-thumb-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
}

.chat-dock-files-thumb-badge.is-hd {
  background: rgba(37, 99, 235, 0.85);
}

.chat-dock-files-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-dock-files-panel:not(.is-grid) .chat-dock-files-badges {
  display: none;
}

.chat-dock-files-badge {
  align-self: flex-start;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.15);
  color: #b91c1c;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.chat-dock-files-badge.is-hd {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.35);
}

.chat-dock-files-badge.is-expired {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.4);
}

.chat-dock-files-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease;
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.chat-dock-files-actions {
  opacity: 0;
  pointer-events: none;
}

.chat-dock-files-item.is-actions-visible .chat-dock-files-actions {
  opacity: 1;
  pointer-events: auto;
}

.chat-dock-files-panel.is-grid .chat-dock-files-actions {
  justify-content: flex-end;
}

.chat-dock-files-action {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.chat-dock-files-action svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-dock-files-action svg * {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-dock-files-action:hover,
.chat-dock-files-action:focus-visible {
  border-color: #cbd5f5;
  color: #334155;
  background: #fff;
  outline: none;
}

.chat-dock-files-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-dock-files-empty {
  text-align: center;
  margin: 0;
}

.chat-dock-files-load-more {
  align-self: center;
  margin-top: 4px;
}


.chat-dock-panel.is-files-open .chat-dock-body,
.chat-dock-panel.is-files-open .chat-dock-composer {
  opacity: 0.1;
  pointer-events: none;
}

.chat-dock-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.chat-dock-minimized-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--color-border);
  background: #fff;
  flex-shrink: 0;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.chat-dock-minimized-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.chat-dock-minimized-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: #0f172a;
  font-size: 0.85rem;
  font-family: inherit;
}

.chat-dock-minimized-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.chat-dock-minimized-input::placeholder {
  color: #94a3b8;
  transition: opacity 0.15s ease;
}

.chat-dock-minimized-input:focus::placeholder {
  opacity: 0;
}

.chat-dock-send-mini {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #e2e8f0;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.chat-dock-send-mini svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-dock-send-mini.is-active {
  background: var(--color-primary);
  color: #fff;
}

.chat-dock-load-more {
  align-self: center;
}

.chat-dock-message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  min-height: 0;
}

.chat-dock-message-list.is-virtual {
  gap: 0;
}

.chat-dock-virtual-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-dock-virtual-spacer {
  height: 0;
  flex: 0 0 auto;
}

.chat-dock-message-list.is-loading {
  pointer-events: none;
}

.chat-dock-message-skeleton {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-dock-skeleton-avatar,
.chat-dock-skeleton-bubble {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: attachments-diff-shimmer 1.4s ease-in-out infinite;
}

.chat-dock-skeleton-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chat-dock-skeleton-bubble {
  height: 32px;
  width: 150px;
  border-radius: 18px;
}

.chat-dock-skeleton-bubble.is-wide {
  width: 200px;
}

.chat-dock-skeleton-bubble.is-narrow {
  width: 110px;
}

.chat-dock-empty {
  margin: 0 0 10px;
}

.chat-dock-review-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 2px;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.chat-dock-review-separator::before,
.chat-dock-review-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
  opacity: 0.9;
}

.chat-dock-review-separator-label {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  font-weight: 600;
  white-space: nowrap;
}

.chat-dock-message {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: relative;
}

.chat-dock-message.is-self {
  align-items: flex-end;
  justify-content: flex-end;
}

.chat-dock-message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 100%;
}

.chat-dock-message.has-thread .chat-dock-message-content {
  width: 100%;
  min-width: 0;
}

.chat-dock-message:not(.is-self):not(.is-system) .chat-dock-message-content {
  max-width: min(100%, calc(100% - 34px));
}

.chat-dock-message.is-self .chat-dock-message-content {
  align-items: flex-end;
  margin-left: auto;
  margin-right: 0;
}

.chat-dock-message-bubble-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}

.chat-dock-message.is-self .chat-dock-message-bubble-wrap {
  align-items: flex-end;
}

.chat-dock-message.has-reactions .chat-dock-message-bubble-wrap {
  padding-bottom: var(--dock-reaction-offset, 14px);
}

.chat-dock-message-content .chat-dock-message-bubble {
  order: 0;
}

.chat-dock-message-content .chat-dock-message-reactions {
  order: 1;
}

.chat-dock-message-content .chat-dock-message-meta {
  order: 2;
}

.chat-dock-thread-wrap {
  width: min(100%, var(--chat-dock-thread-inline-width), var(--chat-dock-thread-max-width));
  max-width: min(100%, var(--chat-dock-thread-inline-width), var(--chat-dock-thread-max-width));
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  padding: 2px;
  border-radius: 16px;
  border: 1px dashed #b188d31a;
  background: #ccb1b10d;
  box-shadow: none;
  box-sizing: border-box;
}

.chat-dock-thread-wrap.is-expanded {
  gap: 10px;
  padding: 7px 9px;
  border: 1px dashed #b188d31a;
  background: #ccb1b10d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.chat-dock-message.is-self .chat-dock-thread-wrap {
  align-items: flex-end;
}

.chat-dock-message.has-thread:not(.is-self) .chat-dock-thread-wrap {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-dock-thread-header {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  box-sizing: border-box;
}

.chat-dock-thread-header.is-self {
  justify-content: flex-end;
}

.chat-dock-thread-header-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.chat-dock-thread-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-dock-thread-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.chat-dock-thread-badge.is-open {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
  border-color: rgba(14, 165, 233, 0.24);
}

.chat-dock-thread-badge.is-resolved {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.chat-dock-thread-badge.is-sla {
  background: rgba(148, 163, 184, 0.18);
  color: #334155;
  border-color: rgba(148, 163, 184, 0.3);
}

.chat-dock-thread-badge.is-sla.is-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.35);
}

.chat-dock-thread-badge.is-sla.is-breach {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.34);
}

.chat-dock-thread-status-meta {
  font-size: 0.66rem;
  line-height: 1.2;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.chat-dock-thread-status-action {
  border: none;
  background: transparent;
  color: #0ea5e9;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.chat-dock-thread-status-action:hover,
.chat-dock-thread-status-action:focus-visible {
  text-decoration: underline;
  outline: none;
}

.chat-dock-thread-status-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-dock-thread {
  --chat-dock-thread-inset: 6px;
  --chat-dock-thread-leading-offset: calc(var(--chat-dock-thread-inset) + 2px);
  --chat-dock-thread-avatar-size: 18px;
  --chat-dock-thread-avatar-gap: 6px;
  --chat-thread-bubble-bg: #eef4ff;
  --chat-thread-bubble-border: rgba(148, 163, 184, 0.42);
  --chat-thread-bubble-color: var(--color-text);
  --chat-thread-bubble-self-bg: #dff1ff;
  --chat-thread-bubble-self-border: rgba(14, 165, 233, 0.34);
  --chat-thread-bubble-self-color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: min(100%, var(--chat-dock-thread-max-width));
  padding: 2px 0 2px var(--chat-dock-thread-inset);
  border-left: 2px solid rgba(148, 163, 184, 0.35);
  align-items: flex-start;
  box-sizing: border-box;
}

.chat-dock-message.is-self .chat-dock-thread {
  padding-left: 0;
  padding-right: var(--chat-dock-thread-inset);
  border-left: none;
  align-items: flex-end;
}

.chat-dock-message.has-thread:not(.is-self) .chat-dock-thread {
  padding-left: var(--chat-dock-thread-inset);
  padding-right: 0;
  border-left: 2px solid rgba(148, 163, 184, 0.01);
  border-right: none;
  align-items: flex-start;
}

.chat-dock-thread-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 0;
  color: var(--color-text);
  min-width: 0;
  position: relative;
  width: auto;
  max-width: 100%;
  align-self: flex-start;
  flex: 0 0 auto;
}

.chat-dock-thread-item.has-avatar {
  gap: var(--chat-dock-thread-avatar-gap);
}

.chat-dock-thread-item.has-avatar:not(.is-self) {
  margin-left: calc(0px - var(--chat-dock-thread-leading-offset));
}

.chat-dock-message.is-self .chat-dock-thread-item.has-avatar:not(.is-self) {
  margin-left: 0;
}

.chat-dock-thread-item,
.chat-dock-thread-item.is-self {
  max-width: min(100%, var(--chat-dock-thread-max-width));
}

.chat-dock-thread-item.has-reactions {
  padding-bottom: 18px;
}

.chat-dock-thread-item.is-self {
  flex-direction: row-reverse;
  align-self: flex-end;
  width: 100%;
  max-width: 100%;
  justify-content: flex-start;
}

.chat-dock-thread-avatar {
  width: var(--chat-dock-thread-avatar-size);
  height: var(--chat-dock-thread-avatar-size);
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 var(--chat-dock-thread-avatar-size);
  text-transform: uppercase;
}

.chat-dock-thread-item.has-avatar:not(.is-self) .chat-dock-thread-avatar {
  position: absolute;
  top: 0;
  right: calc(100% + var(--chat-dock-thread-avatar-gap));
}

.chat-dock-thread-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-dock-thread-bubble {
  --chat-dock-bubble-line-height: 1.4em;
  background: var(--chat-thread-bubble-bg);
  border: 1px solid var(--chat-thread-bubble-border);
  border-radius: var(--radius-lg);
  padding: 7px 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--chat-thread-bubble-color);
  box-shadow: none;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  width: auto;
  max-width: min(100%, var(--chat-dock-thread-max-width));
  flex: 0 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-dock-thread-bubble-wrap {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-start;
  min-width: 0;
  position: relative;
  width: auto;
  max-width: 100%;
  flex: 0 1 auto;
}

.chat-dock-thread-item.is-self .chat-dock-thread-bubble-wrap {
  align-items: flex-end;
  max-width: calc(
    100% - var(--chat-dock-thread-avatar-size) - var(--chat-dock-thread-avatar-gap)
  );
}

.chat-dock-thread-item.is-self:not(.has-avatar) .chat-dock-thread-bubble-wrap {
  max-width: 100%;
}

.chat-dock-thread-bubble-wrap .chat-reaction-summary {
  transform: scale(0.92);
  transform-origin: left center;
}

.chat-dock-thread-item.is-self .chat-dock-thread-bubble-wrap .chat-reaction-summary {
  transform-origin: right center;
}

.chat-dock-thread-bubble-wrap .chat-dock-message-reactions {
  position: absolute;
  left: 6px;
  bottom: -24px;
  align-self: flex-start;
  margin-top: 0;
  box-shadow: none;
  border-color: rgba(148, 163, 184, 0.35);
  background: #fff;
  z-index: 1;
}

.chat-dock-thread-item.is-self
  .chat-dock-thread-bubble-wrap
  .chat-dock-message-reactions {
  left: auto;
  right: 6px;
  align-self: flex-end;
}

.chat-dock-thread-item .chat-reaction-tool.is-thread {
  position: absolute;
  left: 6px;
  bottom: -2px;
  opacity: 0;
  pointer-events: none;
  transform: none;
  margin-top: 0;
  z-index: 1;
}

.chat-dock-thread-item.is-self .chat-reaction-tool.is-thread {
  left: auto;
  right: 6px;
}

.chat-dock-message.is-reaction-hover
  .chat-dock-thread-item
  .chat-reaction-tool.is-thread {
  opacity: 0;
  pointer-events: none;
}

.chat-dock-message.is-reaction-hover
  .chat-dock-thread-item:hover
  .chat-reaction-tool.is-thread,
.chat-dock-message.is-reaction-hover
  .chat-dock-thread-item:focus-within
  .chat-reaction-tool.is-thread {
  opacity: 1;
  pointer-events: auto;
}

.chat-dock-thread-item:hover .chat-reaction-tool.is-thread,
.chat-dock-thread-item:focus-within .chat-reaction-tool.is-thread,
.chat-dock-thread-item .chat-reaction-tool.is-thread:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.chat-dock-thread-item .chat-reaction-tool.is-thread .chat-reaction-trigger {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  box-shadow: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.chat-dock-thread-item .chat-reaction-tool.is-thread .chat-reaction-trigger svg {
  width: 12px;
  height: 12px;
}

.chat-dock-thread-item .chat-reaction-tool.is-thread .chat-reaction-popover {
  bottom: calc(100% + 4px);
  left: 0;
}

.chat-dock-thread-item .chat-reaction-tool.is-thread .chat-reaction-popover.is-below {
  top: calc(100% + 4px);
  bottom: auto;
}

.chat-dock-thread-item.is-self
  .chat-reaction-tool.is-thread
  .chat-reaction-popover {
  left: auto;
  right: 0;
}

.chat-dock-thread-item.is-self .chat-dock-thread-bubble {
  background: var(--chat-thread-bubble-self-bg);
  border: 1px solid var(--chat-thread-bubble-self-border);
  color: var(--chat-thread-bubble-self-color);
  text-align: right;
}

.chat-dock-thread-item .chat-dock-thread-bubble,
.chat-dock-thread-item .chat-dock-message-bubble {
  width: auto !important;
  min-width: 0;
  max-width: 100% !important;
}

.chat-dock-thread-item.is-self .chat-dock-thread-meta {
  text-align: right;
}

.chat-dock-thread-meta {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
  width: auto;
  max-width: 100%;
}

.chat-dock-thread-item.is-meta-open .chat-dock-thread-meta {
  display: flex;
  margin-bottom: 3px;
}

.chat-dock-thread-meta-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-dock-thread-meta-reply {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.chat-dock-thread-meta-reply:hover,
.chat-dock-thread-meta-reply:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  outline: none;
}

.chat-dock-bubble-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.chat-dock-bubble-text-content {
  display: block;
  min-width: 0;
  max-width: 100%;
  line-height: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-dock-bubble-text.is-collapsible.is-collapsed
  .chat-dock-bubble-text-content {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--chat-dock-bubble-clamp-lines, 4);
  max-height: calc(
    var(--chat-dock-bubble-line-height, 1.45em) *
      var(--chat-dock-bubble-clamp-lines, 4)
  );
}

.chat-dock-bubble-toggle {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.chat-dock-message.is-self .chat-dock-bubble-toggle,
.chat-dock-thread-item.is-self .chat-dock-bubble-toggle {
  align-self: flex-end;
  color: #0369a1;
}

.chat-dock-bubble-toggle:hover,
.chat-dock-bubble-toggle:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  outline: none;
}

.chat-dock-message.is-self .chat-dock-bubble-toggle:hover,
.chat-dock-message.is-self .chat-dock-bubble-toggle:focus-visible,
.chat-dock-thread-item.is-self .chat-dock-bubble-toggle:hover,
.chat-dock-thread-item.is-self .chat-dock-bubble-toggle:focus-visible {
  color: #075985;
}

.chat-dock-thread-text {
  font-size: 0.82rem;
  color: var(--color-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-dock-thread-reply {
  align-self: flex-start;
  margin-top: 4px;
  border: none;
  background: transparent;
  color: #0ea5e9;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.chat-dock-message.is-self .chat-dock-thread-reply {
  align-self: flex-end;
}

.chat-dock-thread-reply:hover,
.chat-dock-thread-reply:focus-visible {
  color: #0284c7;
  text-decoration: underline;
  outline: none;
}

.chat-dock-thread-toggle {
  align-self: flex-start;
  border: 1px solid rgba(14, 165, 233, 0.2);
  background: rgba(14, 165, 233, 0.08);
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 999px;
}

.chat-dock-message.is-self .chat-dock-thread-toggle {
  align-self: flex-end;
}

.chat-dock-thread-toggle.is-collapse {
  color: #475569;
  border-color: rgba(148, 163, 184, 0.32);
  background: rgba(148, 163, 184, 0.1);
}

.chat-dock-thread-toggle:hover,
.chat-dock-thread-toggle:focus-visible {
  text-decoration: underline;
  outline: none;
}

.chat-dock-thread-composer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-sizing: border-box;
  min-width: 0;
}

.chat-dock-thread-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 5px 9px;
  font-size: 0.82rem;
  line-height: 1.3;
  resize: none;
  min-height: 30px;
  background: #fff;
  color: var(--color-text);
}

.chat-dock-thread-input:focus {
  outline: 2px solid rgba(59, 130, 246, 0.35);
  border-color: rgba(59, 130, 246, 0.5);
}

.chat-dock-thread-send {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.chat-dock-thread-send svg {
  width: 14px;
  height: 14px;
}

.chat-dock-thread-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-dock-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  --presence-size: 8px;
}

.chat-dock-message.has-reactions .chat-dock-message-avatar {
  transform: translateY(calc(var(--dock-reaction-offset, 14px) * -0.5));
}

.chat-dock-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-dock-message.is-self .chat-dock-message-avatar {
  display: none;
}

.chat-dock-message-bubble {
  --chat-dock-bubble-line-height: 1.4em;
  max-width: min(100%, var(--chat-dock-message-max-width));
  padding: 8px 12px;
  margin: 0;
  border-radius: var(--radius-lg);
  background: #f1f5f9;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  flex-shrink: 0;
  position: relative;
}

.chat-dock-message-bubble.is-rich-text {
  --chat-dock-bubble-line-height: 1.55em;
  line-height: 1.55;
}

.chat-dock-message-bubble.is-multiline {
  padding-top: 10px;
  padding-bottom: 10px;
}

.chat-dock-message-text {
  color: inherit;
}

.chat-dock-message-bubble.has-long-token,
.chat-dock-thread-bubble.has-long-token {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-dock-message.is-self .chat-dock-message-bubble {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.chat-dock-message.is-system .chat-dock-message-bubble {
  background: rgba(148, 163, 184, 0.25);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  font-style: italic;
}

.chat-dock-message.is-ai-trace .chat-dock-message-bubble {
  max-width: min(360px, 100%);
  padding: 8px;
  border: 1px solid rgba(14, 165, 233, 0.28);
  background: linear-gradient(180deg, #f8fbff 0%, #eef8ff 100%);
  font-style: normal;
}

.chat-dock-message.is-ai-thinking .chat-dock-message-bubble {
  max-width: min(260px, 100%);
  border: 1px dashed rgba(2, 132, 199, 0.42);
  background: linear-gradient(180deg, #f8fbff 0%, #f0f9ff 100%);
  font-style: normal;
}

.chat-ai-thinking-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-ai-thinking-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f172a;
}

.chat-ai-thinking-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chat-ai-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-ai-thinking-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #0284c7;
  opacity: 0.25;
  animation: chat-ai-thinking-dot 1.2s ease-in-out infinite;
}

.chat-ai-thinking-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.chat-ai-thinking-dot:nth-child(3) {
  animation-delay: 0.32s;
}

.chat-ai-thinking-meta {
  font-size: 0.66rem;
  color: #475569;
}

.chat-ai-thinking-actions {
  display: flex;
  justify-content: flex-start;
}

.chat-ai-thinking-cancel {
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(254, 226, 226, 0.85);
  color: #991b1b;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.66rem;
  cursor: pointer;
}

.chat-ai-thinking-cancel:disabled {
  opacity: 0.7;
  cursor: default;
}

@keyframes chat-ai-thinking-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.25;
  }
  40% {
    transform: translateY(-2px);
    opacity: 1;
  }
}

.chat-ai-trace-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-ai-trace-answer {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #0f172a;
}

.chat-ai-trace-meta {
  font-size: 0.68rem;
  color: #334155;
}

.chat-ai-trace-fallback {
  font-size: 0.7rem;
  color: #9a3412;
  background: rgba(255, 237, 213, 0.85);
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-radius: 8px;
  padding: 4px 6px;
}

.chat-ai-trace-turn-timeline {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
  padding: 6px;
  display: grid;
  gap: 6px;
}

.chat-ai-trace-turn-timeline-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-ai-trace-turn-timeline-list {
  display: grid;
  gap: 4px;
}

.chat-ai-trace-turn-timeline-row {
  display: grid;
  gap: 1px;
}

.chat-ai-trace-turn-timeline-label {
  font-size: 0.7rem;
  color: #0f172a;
  line-height: 1.25;
}

.chat-ai-trace-turn-timeline-detail {
  font-size: 0.66rem;
  color: #1e293b;
  line-height: 1.35;
}

.chat-ai-trace-turn-timeline-meta {
  font-size: 0.64rem;
  color: #475569;
}

.chat-ai-trace-inspector {
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.chat-ai-trace-inspector-summary {
  cursor: pointer;
  padding: 7px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
  user-select: none;
}

.chat-ai-trace-inspector-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 8px 6px;
}

.chat-ai-trace-inspector-badge {
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(239, 246, 255, 0.9);
  color: #0f172a;
  font-size: 0.64rem;
  line-height: 1.2;
  padding: 2px 6px;
}

.chat-ai-trace-inspector-body {
  display: grid;
  gap: 8px;
  padding: 0 8px 8px;
}

.chat-ai-trace-inspector-section {
  display: grid;
  gap: 5px;
}

.chat-ai-trace-inspector-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-ai-trace-inspector-meta-list {
  display: grid;
  gap: 3px;
}

.chat-ai-trace-inspector-meta-row {
  font-size: 0.66rem;
  color: #334155;
  line-height: 1.35;
  word-break: break-word;
}

.chat-ai-trace-inspector-plan-list,
.chat-ai-trace-inspector-tool-list {
  display: grid;
  gap: 5px;
}

.chat-ai-trace-inspector-plan-item,
.chat-ai-trace-inspector-tool-item {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.9);
  padding: 6px;
}

.chat-ai-trace-inspector-plan-item.is-in_progress,
.chat-ai-trace-inspector-tool-item.is-running {
  border-color: rgba(59, 130, 246, 0.3);
}

.chat-ai-trace-inspector-plan-item.is-completed,
.chat-ai-trace-inspector-tool-item.is-done,
.chat-ai-trace-inspector-tool-item.is-approved {
  border-color: rgba(22, 163, 74, 0.3);
}

.chat-ai-trace-inspector-tool-item.is-canceled,
.chat-ai-trace-inspector-tool-item.is-errored {
  border-color: rgba(239, 68, 68, 0.28);
}

.chat-ai-trace-inspector-plan-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.chat-ai-trace-inspector-plan-label {
  font-size: 0.68rem;
  color: #0f172a;
  line-height: 1.35;
  flex: 1;
}

.chat-ai-trace-inspector-plan-status,
.chat-ai-trace-inspector-tool-status {
  font-size: 0.62rem;
  color: #334155;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.9);
  padding: 2px 6px;
  white-space: nowrap;
}

.chat-ai-trace-inspector-tool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.chat-ai-trace-inspector-tool-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.chat-ai-trace-inspector-tool-detail {
  margin-top: 3px;
  font-size: 0.65rem;
  color: #475569;
  line-height: 1.35;
}

.chat-ai-trace-hitl {
  border: 1px solid rgba(14, 116, 144, 0.24);
  border-radius: 8px;
  background: rgba(236, 254, 255, 0.6);
  padding: 6px;
  display: grid;
  gap: 6px;
}

.chat-ai-trace-hitl-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-ai-trace-hitl-question {
  display: grid;
  gap: 4px;
}

.chat-ai-trace-hitl-question-text {
  font-size: 0.72rem;
  color: #0f172a;
  line-height: 1.35;
}

.chat-ai-trace-hitl-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chat-ai-trace-hitl-option {
  border: 1px solid rgba(14, 116, 144, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.67rem;
  cursor: pointer;
}

.chat-ai-trace-hitl-option.is-recommended {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(236, 253, 245, 0.95);
}

.chat-ai-trace-orchestration {
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 6px;
  display: grid;
  gap: 5px;
}

.chat-ai-trace-orchestration-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-ai-trace-orchestration-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chat-ai-trace-orchestration-badge {
  font-size: 0.65rem;
  color: #0f172a;
  border: 1px solid rgba(14, 165, 233, 0.24);
  background: rgba(224, 242, 254, 0.65);
  border-radius: 999px;
  padding: 2px 6px;
  line-height: 1.2;
}

.chat-ai-trace-orchestration-agents,
.chat-ai-trace-orchestration-handoff {
  font-size: 0.68rem;
  color: #334155;
  line-height: 1.35;
}

.chat-ai-trace-orchestration-handoffs {
  display: grid;
  gap: 3px;
}

.chat-ai-trace-orchestration-fallback {
  font-size: 0.67rem;
  color: #9a3412;
}

.chat-ai-trace-steps {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.chat-ai-trace-step {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.78);
  padding: 6px;
}

.chat-ai-trace-step.is-done {
  border-color: rgba(22, 163, 74, 0.32);
}

.chat-ai-trace-step.is-failed {
  border-color: rgba(239, 68, 68, 0.35);
}

.chat-ai-trace-step.is-skipped {
  border-color: rgba(245, 158, 11, 0.35);
}

.chat-ai-trace-step-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
}

.chat-ai-trace-step-meta {
  margin-top: 2px;
  font-size: 0.68rem;
  color: #475569;
}

.chat-ai-trace-step-summary {
  margin-top: 2px;
  font-size: 0.72rem;
  color: #334155;
  line-height: 1.35;
}

.chat-ai-trace-debug {
  margin-top: 4px;
  border: 1px dashed rgba(15, 23, 42, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.chat-ai-trace-debug-summary {
  cursor: pointer;
  padding: 6px 8px;
  font-size: 0.7rem;
  color: #0f172a;
  font-weight: 600;
  user-select: none;
}

.chat-ai-trace-debug-content {
  margin: 0;
  padding: 0 8px 8px;
  font-size: 0.67rem;
  line-height: 1.35;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}

.chat-dock-message.is-emoji .chat-dock-message-bubble {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px 6px;
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.chat-dock-message.is-sticker .chat-dock-message-bubble {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px;
  margin: 0;
}

.chat-dock-message.is-sticker .chat-sticker-image {
  width: 140px;
}

.chat-dock-message.is-attachment-only .chat-dock-message-bubble {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px 0;
}

.chat-dock-message-attachments {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.chat-dock-message-attachments.is-image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chat-dock-message-attachments.is-image-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.chat-dock-message-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  appearance: none;
}

.chat-dock-message-attachments.is-image-grid .chat-dock-message-attachment {
  padding: 0;
  border: none;
  background: transparent;
}

.chat-dock-message.is-self .chat-dock-message-attachment {
  border-color: rgba(14, 165, 233, 0.2);
  background: #f0f9ff;
}

.chat-dock-message-attachment.is-expired {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-dock-message-attachment:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

.chat-dock-message-attachment-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #f1f5f9;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.chat-dock-message-attachments.is-image-grid .chat-dock-message-attachment-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
}

.chat-dock-message-attachments.is-image-grid.is-single
  .chat-dock-message-attachment-thumb {
  aspect-ratio: auto;
  max-height: 280px;
}

.chat-dock-message-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-dock-message-attachment-thumb.is-loading {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: attachments-diff-shimmer 1.4s ease-in-out infinite;
}

.chat-dock-message-attachment-thumb.is-loading img {
  opacity: 0;
}

.chat-dock-message-attachment-thumb.is-error {
  position: relative;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: attachments-diff-shimmer 1.4s ease-in-out infinite;
}

.chat-dock-message-attachment-thumb.is-error img {
  opacity: 0;
}

.chat-dock-message-attachment.has-more .chat-dock-message-attachment-thumb img {
  filter: brightness(0.58);
}

.chat-dock-message-attachment-more {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.12) 0%,
    rgba(15, 23, 42, 0.58) 100%
  );
  color: #ffffff;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 1;
}

.chat-dock-message-attachment-retry {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: rgba(248, 250, 252, 0.7);
  color: #475569;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  z-index: 2;
}

.chat-dock-message-attachment-thumb.is-error .chat-dock-message-attachment-retry {
  opacity: 1;
  pointer-events: auto;
}

.chat-dock-message-attachment-hd {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.chat-dock-message-attachment-retry svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-dock-message-attachments.is-image-grid.is-single
  .chat-dock-message-attachment-thumb img {
  object-fit: contain;
}

.chat-dock-message-attachment-icon {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
}

.chat-dock-message-attachment.is-image-only .chat-dock-message-attachment-info,
.chat-dock-message-attachment.is-image-only .chat-dock-message-attachment-badge {
  display: none;
}

.chat-dock-message-attachment-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.chat-dock-message-attachment-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-message-attachment-meta {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.chat-dock-message-attachment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 4px;
  width: fit-content;
}

.chat-attachment-preview {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10030;
}

.chat-attachment-preview.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.chat-attachment-preview.is-expanded {
  z-index: 10040;
}

.chat-attachment-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.chat-attachment-preview-card {
  position: relative;
  background: transparent;
  border-radius: 0;
  padding: 0;
  max-width: min(92vw, 960px);
  max-height: 90vh;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 1;
  overflow: hidden;
}

.chat-attachment-preview.is-expanded .chat-attachment-preview-card {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  padding: 0;
  overflow: visible;
}

.chat-attachment-preview-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  flex: 0 1 auto;
  max-width: 100%;
  max-height: calc(90vh - 120px);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}

.chat-attachment-preview-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  transform-origin: 0 0;
  transition: transform 0.12s ease;
}

.chat-attachment-preview-skeleton {
  width: clamp(260px, 72vw, 860px);
  max-width: 100%;
  min-height: 220px;
  height: clamp(220px, 56vh, 620px);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background-color: rgba(71, 85, 105, 0.3);
  background-image: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.2) 0%,
    rgba(248, 250, 252, 0.88) 48%,
    rgba(148, 163, 184, 0.2) 100%
  );
  background-size: 240% 100%;
  animation: preview-skeleton-shimmer 1.1s linear infinite;
}

@keyframes preview-skeleton-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.chat-attachment-preview.has-thumbnails .chat-attachment-preview-media {
  max-height: calc(90vh - 160px);
}

.chat-attachment-preview.is-expanded .chat-attachment-preview-media {
  flex: 0 1 auto;
  max-height: calc(90vh - 80px);
  overflow: visible;
}

.chat-attachment-preview.is-expanded.has-thumbnails .chat-attachment-preview-media {
  max-height: calc(90vh - 120px);
}

.chat-attachment-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 18px;
}

.chat-attachment-preview.is-zoomed .chat-attachment-preview-image {
  cursor: grab;
}

.chat-attachment-preview.is-panning .chat-attachment-preview-image {
  cursor: grabbing;
}
.chat-attachment-preview.is-expanded .chat-attachment-preview-image {
  max-width: 90vw;
  max-height: calc(90vh - 80px);
}

.chat-attachment-preview.is-expanded.has-thumbnails .chat-attachment-preview-image {
  max-height: calc(90vh - 120px);
}

.chat-attachment-preview-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.chat-attachment-preview-thumbnails {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  flex: 0 0 auto;
  padding-left: 4px;
  padding-right: 4px;
}

.chat-attachment-preview.is-zoomed .chat-attachment-preview-media {
  z-index: 1;
}

.chat-attachment-preview.is-zoomed .chat-attachment-preview-thumbnails {
  position: relative;
  z-index: 3;
  opacity: 0.3;
  transition: opacity var(--transition-base);
}

.chat-attachment-preview.is-zoomed .chat-attachment-preview-thumbnails:hover,
.chat-attachment-preview.is-zoomed .chat-attachment-preview-thumbnails:focus-within {
  opacity: 1;
}

.chat-attachment-preview-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.chat-attachment-preview-thumbnails-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 6px;
}

.chat-attachment-preview-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  flex: 0 0 auto;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.chat-attachment-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-attachment-preview-thumb.is-active {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}

.chat-attachment-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity var(--transition-base), background var(--transition-base);
}

.chat-attachment-preview-download {
  position: absolute;
  top: 12px;
  right: 54px;
  z-index: 4;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity var(--transition-base), background var(--transition-base);
}

.chat-attachment-preview-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(241, 245, 249, 0.92);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity var(--transition-base), background var(--transition-base);
  transform: translateY(-50%);
}

.chat-attachment-preview-prev {
  left: 12px;
}

.chat-attachment-preview-next {
  right: 12px;
}

.chat-attachment-preview-close:hover,
.chat-attachment-preview-close:focus-visible {
  background: #e2e8f0;
  outline: none;
  opacity: 1;
}

.chat-attachment-preview-download:hover,
.chat-attachment-preview-download:focus-visible {
  background: #e2e8f0;
  outline: none;
  opacity: 1;
}

.chat-attachment-preview-nav:hover,
.chat-attachment-preview-nav:focus-visible {
  background: #e2e8f0;
  outline: none;
  opacity: 1;
}

.chat-attachment-preview-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-attachment-preview-download svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-attachment-preview-nav svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-document-preview {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10035;
}

.chat-document-preview.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.chat-document-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
}

.chat-document-preview-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 1080px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.chat-document-preview-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.45), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
}

.chat-document-preview-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-document-preview-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-document-preview-kind {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.chat-document-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.chat-document-preview-action {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}

.chat-document-preview-action:hover,
.chat-document-preview-action:focus-visible {
  background: #cbd5e1;
  color: #0f172a;
  outline: none;
}

.chat-document-preview-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-document-preview-body {
  min-height: min(72vh, 760px);
  background: #e2e8f0;
  padding: 18px;
  overflow: auto;
}

.chat-document-preview-body.is-pdf {
  padding: 0;
  background: #cbd5e1;
}

.chat-document-preview-status {
  min-height: calc(min(72vh, 760px) - 36px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #475569;
  font-size: 0.95rem;
}

.chat-document-preview-body:is(.is-pdf, .is-docx) .chat-document-preview-status {
  display: none;
}

.chat-document-preview-frame {
  width: 100%;
  height: min(76vh, 780px);
  border: none;
  background: #fff;
}

.chat-document-preview-docx-shell {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  overflow: auto;
}

.chat-document-preview-docx-shell .attachments-docx-preview {
  min-height: min(68vh, 720px);
}

.chat-document-preview-docx-shell .attachments-docx-preview section.docx {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .chat-document-preview-card {
    width: 96vw;
    max-height: 92vh;
    border-radius: 20px;
  }

  .chat-document-preview-toolbar {
    padding: 14px 16px;
  }

  .chat-document-preview-body {
    min-height: 60vh;
    padding: 12px;
  }

  .chat-document-preview-body.is-pdf {
    padding: 0;
  }

  .chat-document-preview-status {
    min-height: calc(60vh - 24px);
  }

  .chat-document-preview-frame {
    height: 68vh;
  }

  .chat-document-preview-docx-shell {
    padding: 12px;
    border-radius: 14px;
  }
}

.chat-dock-message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  overflow: hidden;
  max-width: min(100%, var(--chat-dock-meta-max-width));
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  transition: opacity 0.15s ease, max-height 0.15s ease, margin-top 0.15s ease;
}

.chat-dock-message-meta-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-message-meta-reply {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.chat-dock-message-meta-reply:hover,
.chat-dock-message-meta-reply:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  outline: none;
}

.chat-dock-message.is-self .chat-dock-message-meta {
  align-self: flex-end;
  text-align: right;
}

.chat-dock-message-meta {
  align-self: flex-end;
  text-align: right;
}

.chat-dock-message.is-meta-open .chat-dock-message-meta {
  max-height: 28px;
  margin-top: 4px;
  opacity: 1;
}

.chat-dock-message > .chat-reaction-tool.is-dock:not(.is-thread) {
  left: 34px;
}

.chat-dock-message.is-self > .chat-reaction-tool.is-dock:not(.is-thread) {
  left: auto;
  right: 8px;
}

.chat-dock-message.is-reaction-hover .chat-reaction-tool,
.chat-dock-message .chat-reaction-tool:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-dock-message.is-self
  > .chat-reaction-tool.is-dock:not(.is-thread)
  > .chat-reaction-popover {
  right: 0;
  left: auto;
}

.chat-dock-message-reactions {
  position: absolute;
  bottom: -8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  z-index: 1;
}

.chat-dock-message:not(.is-self) .chat-dock-message-reactions {
  right: auto;
  left: 8px;
}

.chat-dock-message.is-self .chat-dock-message-reactions {
  right: 8px;
}

.chat-dock-message-reactions .chat-reaction-badge {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 2px 4px;
}

.chat-dock-message.is-pinned .chat-dock-message-bubble::after {
  content: "GHIM";
  position: absolute;
  top: -9px;
  right: -8px;
  font-size: 0.6rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 6px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.chat-dock-pinned {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(var(--dock-header-height, 0px) + 8px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #92400e;
  border: 1px solid rgba(251, 146, 60, 0.4);
  box-shadow: var(--shadow-sm);
  z-index: 3;
  transform: translate3d(0, var(--pinned-offset, 0), 0);
  transition: opacity 0.2s ease, max-width 0.2s ease;
  will-change: transform;
  max-width: 100%;
}

.chat-dock-pinned-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-dock-pinned-text {
  font-size: 0.82rem;
  color: #7c2d12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-dock-pinned-all {
  margin-left: auto;
  border: none;
  background: transparent;
  color: #c2410c;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}

.chat-dock-pinned-all:hover,
.chat-dock-pinned-all:focus-visible {
  text-decoration: underline;
  outline: none;
}

.chat-dock-pinned-list {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(
    var(--dock-header-height, 0px) + var(--dock-pinned-height, 0px) + 16px
  );
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 4;
}

.chat-dock-pinned-item {
  border: none;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-dock-pinned-item-text {
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chat-dock-pinned-item-meta {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.chat-dock-pinned.is-collapsed {
  left: auto;
  right: 12px;
  max-width: 140px;
  padding: 6px 10px;
}

.chat-dock-pinned.is-collapsed .chat-dock-pinned-text {
  display: none;
}

.chat-dock-pinned.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.chat-dock-panel.is-minimized .chat-dock-pinned {
  display: none;
}

.chat-dock-panel.is-minimized .chat-dock-pinned-list {
  display: none;
}

.chat-dock-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.chat-dock-composer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid var(--color-border);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  background: #fff;
  pointer-events: none;
  z-index: 0;
}

.chat-dock-composer > * {
  position: relative;
  z-index: 1;
}

.chat-dock-composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: text;
}

.chat-dock-clarification-banner {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(14, 116, 144, 0.22);
  background:
    linear-gradient(135deg, rgba(236, 254, 255, 0.96), rgba(240, 249, 255, 0.98));
  box-shadow: 0 8px 20px rgba(14, 116, 144, 0.08);
}

.chat-dock-clarification-banner.is-readonly {
  opacity: 0.86;
}

.chat-dock-clarification-banner-header {
  display: grid;
  gap: 4px;
}

.chat-dock-clarification-banner-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-dock-clarification-banner-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-dock-clarification-banner-count {
  font-size: 0.66rem;
  font-weight: 600;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  border-radius: 999px;
  padding: 3px 8px;
}

.chat-dock-clarification-banner-helper {
  font-size: 0.72rem;
  color: #334155;
  line-height: 1.4;
}

.chat-dock-clarification-banner-question {
  display: grid;
  gap: 6px;
}

.chat-dock-clarification-banner-question-text {
  font-size: 0.78rem;
  color: #0f172a;
  line-height: 1.45;
}

.chat-dock-clarification-banner-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-dock-clarification-banner-option {
  border: 1px solid rgba(14, 116, 144, 0.24);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}

.chat-dock-clarification-banner-option.is-recommended {
  border-color: rgba(16, 185, 129, 0.34);
  background: rgba(236, 253, 245, 0.98);
}

.chat-dock-clarification-banner-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-dock-clarification-banner-actions {
  display: flex;
  justify-content: flex-end;
}

.chat-dock-clarification-banner-link {
  border: none;
  background: transparent;
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.chat-dock-clarification-banner-link:hover,
.chat-dock-clarification-banner-link:focus-visible,
.chat-dock-clarification-banner-option:hover,
.chat-dock-clarification-banner-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.16);
}

.chat-dock-turn-console {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  max-height: min(38vh, 280px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(248, 250, 252, 0.98));
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.08);
}

.chat-dock-turn-console-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-dock-turn-console-helper {
  font-size: 0.72rem;
  color: #334155;
  line-height: 1.4;
}

.chat-dock-turn-console-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-dock-turn-console-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
}

.chat-dock-turn-console-badge.is-secondary {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  font-weight: 600;
}

.chat-dock-turn-console-hitl {
  margin-top: 2px;
}

.chat-dock-turn-console-panel {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.92);
}

.chat-dock-turn-console-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.chat-dock-turn-console-panel-title-wrap {
  display: grid;
  gap: 4px;
}

.chat-dock-turn-console-panel-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-dock-turn-console-panel-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: #0f766e;
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}

.chat-dock-turn-console-panel-question {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}

.chat-dock-turn-console-panel-meta {
  display: grid;
  gap: 4px;
}

.chat-dock-turn-console-panel-meta-row {
  font-size: 0.71rem;
  color: #475569;
  line-height: 1.45;
}

.chat-dock-turn-console-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-dock-turn-console-panel-action {
  appearance: none;
  border: 1px solid rgba(14, 116, 144, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.chat-dock-turn-console-panel-action:hover,
.chat-dock-turn-console-panel-action:focus-visible {
  outline: none;
  border-color: rgba(14, 116, 144, 0.45);
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.12);
  transform: translateY(-1px);
}

.chat-dock-turn-console-panel-action.is-primary {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.96), rgba(37, 99, 235, 0.92));
  border-color: rgba(14, 116, 144, 0.42);
  color: #fff;
}

.chat-dock-turn-console-panel-action.is-secondary {
  background: rgba(241, 245, 249, 0.95);
}

.chat-dock-turn-console-panel-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.chat-dock-turn-console-tool-list {
  display: grid;
  gap: 8px;
}

.chat-dock-turn-console-tool-item {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-dock-turn-console-tool-item.is-running {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.92);
}

.chat-dock-turn-console-tool-item.is-done,
.chat-dock-turn-console-tool-item.is-approved {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(240, 253, 244, 0.92);
}

.chat-dock-turn-console-tool-item.is-errored,
.chat-dock-turn-console-tool-item.is-canceled {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(254, 242, 242, 0.92);
}

.chat-dock-turn-console-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-dock-turn-console-tool-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-dock-turn-console-tool-status {
  font-size: 0.68rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.chat-dock-turn-console-tool-detail,
.chat-dock-turn-console-panel-empty {
  font-size: 0.7rem;
  color: #475569;
  line-height: 1.45;
}

.chat-dock-turn-console-events {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.chat-dock-turn-console-events-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-dock-turn-console-events-list {
  display: grid;
  gap: 8px;
}

.chat-dock-turn-console-events-row {
  display: grid;
  gap: 2px;
}

.chat-dock-turn-console-events-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #0f172a;
}

.chat-dock-turn-console-events-detail {
  font-size: 0.7rem;
  color: #475569;
  line-height: 1.45;
}

.chat-dock-turn-console-inspector {
  margin-top: 2px;
}

.chat-dock-turn-console-inspector.chat-ai-trace-inspector {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(255, 255, 255, 0.96);
}

.chat-dock-reply-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: var(--color-text);
}

.chat-dock-reply-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.chat-dock-reply-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-reply-close {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.chat-dock-reply-close:hover,
.chat-dock-reply-close:focus-visible {
  background: #dbe4f0;
  color: #0f172a;
  outline: none;
}

.chat-dock-tool-button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-dock-tool-button:hover,
.chat-dock-tool-button:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
  outline: none;
}

.chat-dock-tool-button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.chat-dock-composer.has-draft-text .chat-dock-tool-secondary.is-hide-when-drafting,
.chat-dock-composer.is-focus .chat-dock-tool-secondary.is-hide-on-focus {
  display: none;
}

.chat-dock-tool-menu {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 10px);
  width: min(320px, 90%);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 5;
}

.chat-dock-tool-menu::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 16px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.chat-dock-emoji-picker {
  position: absolute;
  left: auto;
  right: 52px;
  bottom: calc(100% + 10px);
  width: min(280px, calc(100% - 64px));
  max-height: 320px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 6;
}

.chat-dock-emoji-picker::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: auto;
  right: 24px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.chat-dock-emoji-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 2px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  flex-shrink: 0;
}

.chat-dock-emoji-tab {
  border: 1px solid transparent;
  background: #f8fafc;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-dock-emoji-tab.is-active {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.3);
}

.chat-dock-emoji-tab:hover,
.chat-dock-emoji-tab:focus-visible {
  background: #e2e8f0;
  outline: none;
}

.chat-dock-emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-dock-emoji-button {
  border: none;
  background: #f8fafc;
  border-radius: 10px;
  padding: 6px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-dock-emoji-button:hover,
.chat-dock-emoji-button:focus-visible {
  background: #e2e8f0;
  outline: none;
}

.chat-dock-sticker-picker {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 10px);
  width: min(340px, 92%);
  max-height: 360px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 6;
}

.chat-dock-sticker-picker::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 44px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.chat-dock-mention-menu {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 10px);
  width: min(360px, 92%);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 7;
}

.chat-dock-mention-menu::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 32px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.chat-dock-mention-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  padding: 2px 6px;
}

.chat-dock-mention-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
}

.chat-dock-mention-item {
  border: 1px solid transparent;
  background: #f8fafc;
  color: #0f172a;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.chat-dock-mention-item:hover,
.chat-dock-mention-item:focus-visible {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
  outline: none;
}

.chat-dock-mention-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.chat-dock-mention-desc {
  font-size: 0.75rem;
  color: #64748b;
}

.chat-dock-mention-empty {
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.chat-dock-assignment-preview {
  border: 1px dashed rgba(148, 163, 184, 0.6);
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px;
}

.chat-dock-assignment-preview .chat-assignment-card {
  background: #fff;
}

.chat-dock-attachments-staging {
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-dock-attachments-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-dock-attachments-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.chat-dock-attachments-mode {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-dock-attachments-mode-label {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
}

.chat-dock-attachments-mode-button {
  border: 1px solid transparent;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
}

.chat-dock-attachments-mode-button.is-active {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.3);
}

.chat-dock-attachments-mode-button:hover,
.chat-dock-attachments-mode-button:focus-visible {
  background: #dbeafe;
  outline: none;
}

.chat-dock-attachments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-dock-attachment-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 2px;
}

.chat-dock-attachment-item.is-uploading {
  opacity: 0.85;
}

.chat-dock-attachment-item.is-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(254, 242, 242, 0.8);
}

.chat-dock-attachment-thumb {
  width: 100%;
  height: 72px;
  border-radius: 10px;
  background: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.chat-dock-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-dock-attachment-icon {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.chat-dock-attachment-body {
  display: none;
}

.chat-dock-attachment-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dock-attachment-meta {
  display: none;
}

.chat-dock-attachment-status {
  display: none;
}

.chat-dock-attachment-status:empty {
  display: none;
}

.chat-dock-attachment-retry {
  border: none;
  background: transparent;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.chat-dock-attachment-retry:hover,
.chat-dock-attachment-retry:focus-visible {
  text-decoration: underline;
  outline: none;
}

.chat-dock-attachment-remove {
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.chat-dock-attachment-item:hover .chat-dock-attachment-remove,
.chat-dock-attachment-item:focus-within .chat-dock-attachment-remove {
  opacity: 1;
  pointer-events: auto;
}

.chat-dock-attachment-item.is-uploading .chat-dock-attachment-remove,
.chat-dock-attachments-staging.is-sending .chat-dock-attachment-remove {
  opacity: 0;
  pointer-events: none;
}

.chat-dock-attachment-remove-icon {
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  color: currentColor;
}

.chat-dock-attachment-remove:hover,
.chat-dock-attachment-remove:focus-visible {
  background: #e2e8f0;
  outline: none;
}

.chat-dock-attachment-progress {
  --progress: 0%;
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(
    #3b82f6 0% var(--progress),
    rgba(148, 163, 184, 0.25) var(--progress) 100%
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 4px),
    #000 calc(100% - 3px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 4px),
    #000 calc(100% - 3px)
  );
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.chat-dock-attachment-progress-bar {
  display: none;
}

.chat-assignment-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
}

.chat-attachment-note-card {
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  box-shadow: none;
}

.chat-attachment-note-body {
  position: relative;
  color: #0f172a;
  font-size: 0.82rem;
  line-height: 1.55;
  word-break: break-word;
  padding-left: 12px;
}

.chat-attachment-note-card.is-quote .chat-attachment-note-body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  bottom: 0.15rem;
  width: 3px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.28);
}

.chat-attachment-note-prompt {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.45;
  word-break: break-word;
  margin-left: 12px;
}

.chat-attachment-note-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding-top: 0;
  margin-left: 12px;
  border-top: none;
  flex-wrap: wrap;
}

.chat-attachment-note-meta {
  color: #64748b;
  font-size: 0.7rem;
  line-height: 1.35;
  min-width: 0;
  flex: 0 1 auto;
  word-break: break-word;
}

.chat-attachment-note-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-attachment-note-action {
  border: none;
  background: transparent;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  line-height: 1.2;
}

.chat-attachment-note-action.is-primary {
  color: #1d4ed8;
}

.chat-attachment-note-action:hover,
.chat-attachment-note-action:focus-visible {
  background: transparent;
  color: #1e40af;
  text-decoration: underline;
  outline: none;
}

.chat-attachment-note-action.is-primary:hover,
.chat-attachment-note-action.is-primary:focus-visible {
  background: transparent;
}

.chat-assignment-card.is-compact {
  padding: 6px 8px;
}

.chat-assignment-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-assignment-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: #475569;
}

.chat-assignment-context {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0 4px;
}

.chat-assignment-context-header {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #94a3b8;
}

.chat-assignment-context-block,
.chat-assignment-context-cell {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 10px;
  padding: 8px 10px;
  color: #1e293b;
  line-height: 1.55;
  word-break: break-word;
}

.chat-assignment-context-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
}

.chat-assignment-context-cell.is-selected {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(254, 243, 199, 0.55);
}

.chat-assignment-context-mark {
  background: rgba(250, 204, 21, 0.55);
  color: #0f172a;
  padding: 0 2px;
  border-radius: 4px;
  font-weight: 700;
}

.chat-assignment-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.chat-assignment-label {
  min-width: 70px;
  font-weight: 600;
  color: #94a3b8;
  flex-shrink: 0;
}

.chat-assignment-value {
  color: #334155;
  flex: 1;
  word-break: break-word;
}

.chat-assignment-text {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}

.chat-assignment-link {
  border: none;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.chat-assignment-link:hover,
.chat-assignment-link:focus-visible {
  background: rgba(37, 99, 235, 0.2);
  outline: none;
}

.chat-assignment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chat-assignment-timeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
  font-size: 0.75rem;
  color: #64748b;
}

.chat-assignment-timeline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-assignment-timeline-row.is-sla .chat-assignment-timeline-label {
  color: #ef4444;
}

.chat-assignment-timeline-row.is-past {
  opacity: 0.85;
}

.chat-assignment-timeline-label {
  font-weight: 600;
  color: #475569;
}

.chat-assignment-timeline-time {
  font-weight: 600;
  color: #0f172a;
  text-align: right;
}

.chat-assignment-timeline-empty {
  color: #94a3b8;
}

.chat-assignment-action {
  border: none;
  background: rgba(148, 163, 184, 0.15);
  color: #334155;
  font-weight: 600;
  font-size: 0.76rem;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.chat-assignment-action:hover,
.chat-assignment-action:focus-visible {
  background: rgba(148, 163, 184, 0.28);
  outline: none;
}

.chat-assignment-toggle {
  border: none;
  background: transparent;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.76rem;
  cursor: pointer;
  padding: 4px 0;
  align-self: flex-start;
}

.chat-assignment-toggle:hover,
.chat-assignment-toggle:focus-visible {
  text-decoration: underline;
  outline: none;
}

.chat-dock-message.is-assignment .chat-dock-message-bubble {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.5);
}

.chat-dock-sticker-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 2px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  flex-shrink: 0;
}

.chat-dock-sticker-tab {
  border: 1px solid transparent;
  background: #f8fafc;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-dock-sticker-tab.is-active {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.3);
}

.chat-dock-sticker-tab:hover,
.chat-dock-sticker-tab:focus-visible {
  background: #e2e8f0;
  outline: none;
}

.chat-dock-sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-dock-sticker-button {
  border: 1px solid transparent;
  background: #f8fafc;
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-dock-sticker-button:hover,
.chat-dock-sticker-button:focus-visible {
  background: #e2e8f0;
  outline: none;
}

.chat-sticker-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

.chat-dock-tool-menu-item {
  border: 1px solid transparent;
  background: #f8fafc;
  color: var(--color-text);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  text-align: left;
  position: relative;
}

.chat-dock-tool-menu-item svg {
  width: 20px;
  height: 20px;
  stroke: #2563eb;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-dock-tool-menu-item[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.chat-dock-tool-beta {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.chat-dock-tool-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-dock-input-shell {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.chat-dock-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 44px 10px 12px;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  font-family: inherit;
  line-height: 20px;
  resize: none;
  background: #ffffff;
  flex: 1;
  min-width: 0;
  pointer-events: auto;
  color: #0f172a !important;
  caret-color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  text-shadow: 0 0 0 #0f172a;
  -webkit-appearance: none;
  appearance: none;
  opacity: 1;
}

.chat-dock-input-shell .chat-dock-input-emoji {
  position: absolute;
  top: 50%;
  right: 5px;
  z-index: 2;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  background: transparent;
  color: #64748b;
}

.chat-dock-input-shell .chat-dock-input-emoji:hover,
.chat-dock-input-shell .chat-dock-input-emoji:focus-visible {
  background: #eef2f7;
  color: #0f172a;
}

.chat-dock-input-shell .chat-dock-input {
  position: relative;
  z-index: 1;
}

.chat-dock-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.chat-dock-input::placeholder {
  color: rgba(148, 163, 184, 0.45) !important;
  -webkit-text-fill-color: rgba(148, 163, 184, 0.45) !important;
  text-shadow: none !important;
  transition: opacity 0.15s ease;
}

.chat-dock-input:focus::placeholder {
  opacity: 0;
}

.chat-dock-composer.is-focus .chat-dock-input::placeholder {
  opacity: 0;
}

.chat-dock-input.is-ai-command,
.chat-dock-minimized-input.is-ai-command {
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 0 0 1px rgba(2, 132, 199, 0.2);
}

.chat-dock-send {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: #e2e8f0;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.chat-dock-send svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-dock-send.is-active {
  background: var(--color-primary);
  color: #fff;
}

.chat-dock-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.chat-dock-composer.is-focus .chat-dock-hint {
  max-height: 24px;
  opacity: 1;
  margin-top: 2px;
}

.chat-dock-hint.is-ai-command {
  color: #334155;
}

.chat-dock-hint.is-hitl-pending,
.chat-dock-hint.is-ai-responding {
  max-height: 24px;
  opacity: 1;
  margin-top: 2px;
}

.chat-dock-hint.is-hitl-pending {
  color: #0f172a;
}

.chat-dock-hint.is-ai-responding {
  color: #0f766e;
}

.chat-dock-ai-syntax {
  font-weight: 600;
  color: #475569;
}

.chat-dock-ai-syntax-token {
  color: #0284c7;
}

.chat-dock-debug {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  min-height: 16px;
}

.chat-dock-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-dock-panel.is-minimized .chat-dock-body,
.chat-dock-panel.is-minimized .chat-dock-composer {
  display: none;
}

.chat-dock-panel.is-minimized .chat-dock-minimized-bar {
  display: flex;
}

.chat-dock-panel.is-minimized {
  height: auto;
  max-height: none;
}

body.chat-panel-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .chat-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
  }

  .chat-panel-card {
    border-radius: 0;
  }

  .chat-panel-layout {
    padding: var(--space-3);
  }

  .chat-dock {
    right: 0;
    left: 0;
    justify-content: center;
    padding: 0 12px;
  }

  .chat-dock-panel {
    width: min(100%, 360px);
  }

  @supports selector(.chat-dock:has(.chat-dock-panel)) {
    body.app-logged-in .chat-dock:has(.chat-dock-panel:not(.is-minimized)) {
      inset: 0;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      width: 100vw;
      max-width: none;
      padding: 0;
      justify-content: stretch;
      align-items: stretch;
      z-index: 2400;
    }

    body.app-logged-in
      .chat-dock:has(.chat-dock-panel:not(.is-minimized))
      .chat-dock-panel:not(.is-minimized),
    body.app-logged-in
      .chat-dock:has(.chat-dock-panel:not(.is-minimized))
      .chat-dock-panel.is-pinned:not(.is-minimized) {
      position: relative;
      inset: auto;
      top: auto;
      right: auto;
      bottom: auto;
      width: 100vw;
      height: 100dvh;
      max-height: none;
      border: none;
      border-radius: 0;
      box-shadow: none;
      z-index: auto;
    }

    body.app-logged-in
      .chat-dock:has(.chat-dock-panel:not(.is-minimized))
      .chat-dock-panel:not(.is-minimized)::before {
      border: none;
      border-radius: 0;
    }

    body.app-logged-in
      .chat-dock:has(.chat-dock-panel:not(.is-minimized))
      .chat-dock-header {
      border-top-left-radius: 0;
      border-top-right-radius: 0;
      padding-top: calc(10px + env(safe-area-inset-top, 0px));
    }

    body.app-logged-in
      .chat-dock:has(.chat-dock-panel:not(.is-minimized))
      .chat-dock-composer,
    body.app-logged-in
      .chat-dock:has(.chat-dock-panel:not(.is-minimized))
      .chat-dock-minimized-bar {
      padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
    }
  }

  .chat-dock-resize-handle {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .app-wrapper {
    margin: var(--space-4) auto var(--space-6);
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-xl);
  }

  .app-wrapper.logged-out {
    padding: var(--space-5) var(--space-4);
    gap: var(--space-4);
  }

  .app-watermark {
    left: var(--space-4);
    bottom: var(--space-4);
    height: 36px;
  }

  .tab-menu-toggle {
    display: inline-flex;
    width: 100%;
    justify-content: space-between;
    margin-bottom: var(--space-2);
  }

  #mainTabNav {
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1.25px solid var(--color-border);
    box-shadow: var(--shadow-sm);
  }

  #mainTabNav .main-tab-button-strip {
    width: 100%;
    flex-direction: column;
    gap: var(--space-2);
    overflow: visible;
    padding-block: 0;
  }

  #mainTabNav[data-collapsed="true"] {
    display: none;
  }

  #mainTabNav[data-collapsed="false"] {
    display: flex;
  }

  #mainTabNav .tab-button {
    width: 100%;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
  }

  #mainTabNav .tab-button.tab-settings-button {
    width: 100%;
    height: auto;
    padding: var(--space-3) var(--space-4);
  }

  .tab-content {
    gap: var(--space-4);
  }

  .main-tabs > .tab-pane {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-bar > * {
    width: 100%;
  }

  .resizable-table th,
  .resizable-table td {
    padding: var(--space-2) var(--space-3);
  }

  .table-container {
    border-radius: var(--radius-sm);
  }

  body.modal-open .modal {
    padding: 0;
  }

  .modal-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    padding: var(--space-3);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    border-left-width: 0;
    border-right-width: 0;
    border-bottom-width: 0;
    box-shadow: none;
  }

  .modal-dialog::after {
    border-radius: 0;
    box-shadow: inset 0 1px 0 var(--color-border);
  }

  .modal-dialog .modal-resize-handle {
    display: none !important;
  }

  .modal-actions,
  .modal .action-buttons {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  }

  .modal-actions button,
  .modal .action-buttons button {
    width: 100%;
  }
}

.modal-dialog {
  max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 64px);
}

.modal-dialog .table-container,
.modal-dialog .history-table-container,
.modal-dialog .import-table-wrapper,
.modal-dialog .assignment-import-scroll .table-container {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.modal-dialog .table-container.scrollable,
.modal-dialog .history-table-container.scrollable,
.modal-dialog .import-table-wrapper,
.modal-dialog .virtualized-table-container {
  touch-action: pan-x pan-y;
  overscroll-behavior-y: contain;
  align-items: center;
}

@media (hover: none), (pointer: coarse) {
  .modal-dialog .action-menu-button,
  .modal-dialog .action-menu-item,
  .modal-dialog .modal-reset-option {
    min-height: 44px;
  }

  .modal-dialog .modal-reset-option--preset {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@media (hover: none) and (pointer: coarse) and (min-width: 769px) {
  .modal-dialog {
    max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 48px);
  }

  .modal-dialog .modal-resize-handle {
    display: none !important;
  }

  .modal-actions,
  .modal .action-buttons {
    touch-action: manipulation;
    padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  }

  .modal-actions button,
  .modal-actions .primary-button,
  .modal-actions .secondary-button,
  .modal-actions .danger-button,
  .modal-actions .ghost-button,
  .modal-actions label.primary-button,
  .modal-actions label.secondary-button,
  .modal-actions label.danger-button,
  .modal-actions label.ghost-button,
  .modal .action-buttons button,
  .modal .action-buttons .primary-button,
  .modal .action-buttons .secondary-button,
  .modal .action-buttons .danger-button,
  .modal .action-buttons .ghost-button,
  .modal .action-buttons label.primary-button,
  .modal .action-buttons label.secondary-button,
  .modal .action-buttons label.danger-button,
  .modal .action-buttons label.ghost-button {
    min-height: 46px;
    height: 46px;
  }

  body.modal-vv-keyboard-open .modal-actions,
  body.modal-vv-keyboard-open .modal .action-buttons {
    padding-bottom: calc(
      var(--space-2) + env(safe-area-inset-bottom, 0px) +
        min(var(--modal-visual-viewport-inset-bottom, 0px), 220px)
    );
  }
}

@media (max-width: 768px) {
  .modal-dialog {
    max-height: var(--modal-visual-viewport-height, 100dvh);
  }

  body.modal-vv-keyboard-open .modal-actions,
  body.modal-vv-keyboard-open .modal .action-buttons {
    padding-bottom: calc(
      var(--space-2) + env(safe-area-inset-bottom, 0px) +
        min(var(--modal-visual-viewport-inset-bottom, 0px), 240px)
    );
  }
}

@media (max-width: 768px) {
  body.app-logged-in {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--color-surface-subtle, #f8fafc);
  }

  body.app-logged-in .app-wrapper,
  body.app-logged-in.with-routing-panel .app-wrapper,
  body.app-logged-in.with-weight-panel .app-wrapper,
  body.app-logged-in.with-chat-dock-panel .app-wrapper,
  body.app-logged-in.with-routing-panel.with-weight-panel .app-wrapper,
  body.app-logged-in.with-chat-dock-panel.with-routing-panel .app-wrapper,
  body.app-logged-in.with-chat-dock-panel.with-weight-panel .app-wrapper,
  body.app-logged-in.with-chat-dock-panel.with-routing-panel.with-weight-panel .app-wrapper {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: calc(62px + env(safe-area-inset-top, 0px)) 12px
      calc(86px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--color-surface-subtle, #f8fafc);
    padding-left: 0px;
    padding-right: 0px ;
  }

  body.app-logged-in .landing-header,
  body.app-logged-in .tab-menu-toggle {
    display: none !important;
  }

  body.app-logged-in #mainTabNav,
  body.app-logged-in #mainTabNav[data-collapsed="true"],
  body.app-logged-in #mainTabNav[data-collapsed="false"] {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    width: 100%;
    padding: 8px max(8px, env(safe-area-inset-left, 0px))
      calc(8px + env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-right, 0px));
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.12);
  }

  body.app-logged-in #mainTabNav .main-tab-button-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(64px, 1fr);
    width: 100%;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    padding: 0;
    scrollbar-width: none;
  }

  body.app-logged-in #mainTabNav .main-tab-button-strip::-webkit-scrollbar {
    display: none;
  }

  body.app-logged-in #mainTabNav .main-tab-button {
    min-width: 64px;
    min-height: 54px;
    width: auto;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    color: var(--color-text-muted);
    font-size: 0.72rem;
  }

  body.app-logged-in #mainTabNav .main-tab-button.active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: transparent;
    box-shadow: none;
  }

  body.app-logged-in #mainTabNav .tab-icon,
  body.app-logged-in #mainTabNav .tab-icon svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  body.app-logged-in #mainTabNav .tab-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
  }

  body.app-logged-in .account-menu {
    --account-avatar-size: 38px;
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: 10px;
    z-index: 100;
    gap: 4px;
    margin-left: 0;
    padding: 4px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
  }

  body.app-logged-in .account-menu .ghost-icon-button,
  body.app-logged-in .account-menu__avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  body.app-logged-in .account-menu .ghost-icon-button svg,
  body.app-logged-in .notification-inbox-trigger svg {
    width: 22px;
    height: 22px;
  }

  body.app-logged-in .account-menu__list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    max-width: calc(100vw - 20px);
    z-index: 120;
  }

  body.app-logged-in .main-tabs > .tab-pane {
    margin-top: 0;
    padding: var(--space-1);
    overflow-x: hidden;
  }

  body.app-logged-in .table-container,
  body.app-logged-in .history-table-container,
  body.app-logged-in .virtualized-table-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.chat-panel-pinned.app-logged-in {
    padding-right: 0;
  }

  body.app-logged-in.chat-panel-fullscreen {
    overflow: hidden;
  }

  body.app-logged-in.chat-panel-fullscreen .chat-panel-backdrop {
    z-index: 2290;
  }

  body.app-logged-in.chat-panel-fullscreen .chat-panel {
    inset: 0;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    z-index: 2300;
  }

  body.app-logged-in.chat-panel-fullscreen .chat-panel-card {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.app-logged-in.chat-panel-fullscreen .chat-panel-header {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  body.app-logged-in.chat-panel-fullscreen .chat-panel-layout {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  }

  body.app-logged-in #chatPanelPin {
    display: none;
  }

  body.app-logged-in .routing-panel,
  body.app-logged-in .vtiger-review-weight-panel {
    inset: 0;
    width: 100vw;
    min-width: 0;
    max-width: none;
    border-radius: 0;
    z-index: 95;
  }
}

@media (min-width: 769px) and (any-pointer: fine) {
  .modal-dialog.is-resizable .modal-resize-handle {
    display: block !important;
  }
}

/* Attachment preview scroll containment: the document viewer owns scrolling. */
.attachments-preview-modal .modal-dialog.attachments-preview-dialog--compact,
.attachments-diff-modal .modal-dialog.attachments-preview-dialog--compact,
.attachments-preview-modal .modal-dialog.attachments-preview-dialog--compact.is-resizable,
.attachments-diff-modal .modal-dialog.attachments-preview-dialog--compact.is-resizable {
  overflow: hidden;
}

.attachments-preview-modal
  .modal-dialog.attachments-preview-dialog--compact.is-resizable
  > .attachments-preview-body,
.attachments-diff-modal
  .modal-dialog.attachments-preview-dialog--compact.is-resizable
  > .attachments-preview-body {
  overflow: hidden;
}

/* Attachments file browser UX polish. */
.attachments-file-browser-dialog.modal-dialog {
  width: min(1280px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  height: min(800px, calc(var(--modal-visual-viewport-height, 100dvh) - 48px));
  max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 48px);
  min-width: min(960px, calc(100vw - 48px));
  min-height: min(560px, calc(var(--modal-visual-viewport-height, 100dvh) - 48px));
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--color-surface-subtle);
}

.attachments-file-browser-dialog.modal-dialog.is-resizable {
  min-width: min(860px, calc(100vw - 48px));
  min-height: min(520px, calc(var(--modal-visual-viewport-height, 100dvh) - 48px));
  overflow: hidden;
}

.attachments-file-browser-dialog > .modal-header.attachments-window-header {
  flex: 0 0 auto;
  min-height: 64px;
  padding: 12px 18px;
  border-bottom-color: rgba(100, 116, 139, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94),
    rgba(248, 250, 252, 0.88)
  );
}

.attachments-file-browser-dialog .modal-title-block h3 {
  font-size: 1rem;
  line-height: 1.2;
  color: var(--color-heading);
}

.attachments-file-browser-dialog .modal-title-block .muted {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.attachments-file-browser-dialog > .attachments-file-browser-body.modal-body {
  flex: 1 1 auto;
  gap: 0;
  height: auto;
  min-height: 0;
  padding: var(--space-2);
  overflow: hidden;
  background: var(--color-surface-subtle);
}

.attachments-file-browser-dialog .attachments-file-browser {
  grid-template-columns: minmax(224px, 260px) minmax(0, 1fr) 0;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.attachments-file-browser-dialog .attachments-file-browser.has-preview {
  grid-template-columns: minmax(224px, 260px) minmax(0, 1fr) 340px;
}

.attachments-file-browser-dialog .attachments-file-sidebar {
  padding: var(--space-2);
  gap: 14px;
  background: var(--color-surface-subtle);
  border-right: 1px solid rgba(148, 163, 184, 0.22);
}

.attachments-file-browser-dialog .attachments-storage-domain-list {
  display: grid;
  gap: 8px;
}

.attachments-file-browser-dialog .attachments-storage-domain-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
}

.attachments-file-browser-dialog .attachments-storage-domain-card:not(:disabled):hover,
.attachments-file-browser-dialog .attachments-storage-domain-card:not(:disabled):focus-visible,
.attachments-file-browser-dialog .attachments-storage-domain-card.is-selected {
  border-color: rgba(37, 99, 235, 0.42);
  outline: none;
}

.attachments-file-browser-dialog .attachments-storage-domain-card:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.attachments-file-browser-dialog .attachments-storage-domain-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.attachments-file-browser-dialog .attachments-storage-domain-label {
  overflow: hidden;
  color: var(--color-heading);
  font-size: 0.84rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-file-browser-dialog .attachments-storage-domain-location {
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-file-browser-dialog .attachments-storage-domain-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 96px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.attachments-file-browser-dialog .attachments-storage-domain-status.is-active {
  color: #166534;
}

.attachments-file-browser-dialog .attachments-storage-domain-status.is-planned {
  color: var(--color-text-muted);
}

.attachments-file-browser-dialog .attachments-file-sidebar .filter-field {
  gap: 7px;
  font-size: 0.84rem;
}

.attachments-file-browser-dialog .attachments-file-sidebar label {
  color: var(--color-text);
  font-weight: 650;
}

.attachments-file-browser-dialog .attachments-file-sidebar input,
.attachments-file-browser-dialog .attachments-file-sidebar select,
.attachments-file-browser-dialog .attachments-file-toolbar select,
.attachments-file-browser-dialog .attachments-file-search input {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.88rem;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}

.attachments-file-browser-dialog .attachments-file-sidebar input:focus,
.attachments-file-browser-dialog .attachments-file-sidebar select:focus,
.attachments-file-browser-dialog .attachments-file-toolbar select:focus,
.attachments-file-browser-dialog .attachments-file-search input:focus {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
  outline: none;
}

.attachments-file-browser-dialog .attachments-file-date-range {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
}

.attachments-file-browser-dialog .attachments-file-date-range span {
  font-size: 0.85rem;
}

.attachments-file-browser-dialog .attachments-file-toggle {
  padding: 2px 0;
}

.attachments-file-browser-dialog .attachments-file-toggle label {
  color: var(--color-text-muted);
  font-weight: 600;
}

.attachments-file-browser-dialog .attachments-file-toggle input {
  min-height: auto;
  width: 16px;
  height: 16px;
  box-shadow: none;
}

.attachments-file-browser-dialog .attachments-file-browser .attachments-file-main {
  display: flex;
  flex-direction: column;
  padding: var(--space-2);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  background: var(--color-surface);
}

.attachments-file-browser-dialog .attachments-file-toolbar {
  position: relative;
  top: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
  padding: var(--space-2);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.attachments-file-browser-dialog .attachments-file-toolbar-left,
.attachments-file-browser-dialog .attachments-file-toolbar-right {
  gap: 8px;
}

.attachments-file-browser-dialog .attachments-file-toolbar-left {
  flex-wrap: nowrap;
}

.attachments-file-browser-dialog .attachments-file-toolbar-right {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.attachments-file-browser-dialog .attachments-file-nav {
  display: none;
}

.attachments-file-browser-dialog .attachments-file-path {
  min-width: 150px;
  max-width: 240px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-surface-subtle);
  color: var(--color-heading);
  font-weight: 700;
}

.attachments-file-browser-dialog .attachments-file-segment {
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: var(--color-surface-subtle);
  padding: 2px;
}

.attachments-file-browser-dialog .attachments-file-segment button {
  min-width: 34px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--color-text-muted);
  font-weight: 650;
}

.attachments-file-browser-dialog .attachments-file-segment button.is-active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.attachments-file-browser-dialog .attachments-file-view-toggle button {
  width: 32px;
  height: 32px;
  padding: 0;
}

.attachments-file-browser-dialog .attachments-file-toolbar select {
  min-width: 120px;
  padding: 6px 34px 6px 12px;
}

.attachments-file-browser-dialog #attachmentsFileRefresh {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: var(--color-surface);
}

.attachments-file-browser-dialog #attachmentsFileRefresh:disabled {
  cursor: progress;
  opacity: 0.58;
}

.attachments-file-browser-dialog .attachments-file-search {
  flex: 1 1 190px;
}

.attachments-file-browser-dialog .attachments-file-search input {
  width: 100%;
  min-width: 180px;
  padding: 7px 12px;
}

.attachments-file-browser-dialog .attachments-file-banner {
  border-radius: 8px;
}

.attachments-file-browser-dialog .attachments-file-table.table-container.scrollable {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: var(--color-surface);
  overflow: auto;
  box-shadow: none;
}

.attachments-file-browser-dialog .attachments-file-list {
  min-width: 820px;
  gap: 0;
}

.attachments-file-browser-dialog .attachments-file-list--storage {
  min-width: 900px;
}

.attachments-file-browser-dialog .attachments-file-list-header {
  grid-template-columns: minmax(220px, 2fr) 118px 70px 168px 162px 152px;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-surface-subtle);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.attachments-file-browser-dialog .attachments-file-list-header--storage,
.attachments-file-browser-dialog .attachments-file-row--storage {
  grid-template-columns: minmax(280px, 2.2fr) 112px 100px 168px 88px 132px;
}

.attachments-file-browser-dialog .attachments-file-folder {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0;
  box-shadow: none;
}

.attachments-file-browser-dialog
  .attachments-file-list-header
  + .attachments-file-folder {
  border-top: 0;
}

.attachments-file-browser-dialog .attachments-file-folder-toggle {
  min-height: 54px;
  padding: 12px 16px;
  background: var(--color-surface);
  border-radius: 0;
}

.attachments-file-browser-dialog .attachments-file-folder-toggle:hover,
.attachments-file-browser-dialog .attachments-file-folder-toggle:focus-visible {
  background: rgba(37, 99, 235, 0.06);
  outline: none;
}

.attachments-file-browser-dialog
  .attachments-file-folder-toggle[aria-expanded="true"] {
  background: rgba(37, 99, 235, 0.04);
}

.attachments-file-browser-dialog .attachments-file-folder-icon {
  width: 16px;
  color: var(--color-text-muted);
  font-size: 0.76rem;
}

.attachments-file-browser-dialog .attachments-file-folder-name {
  color: var(--color-heading);
  font-size: 0.94rem;
  font-weight: 750;
}

.attachments-file-browser-dialog .attachments-file-folder-meta {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.1);
  color: var(--color-text-muted);
  font-size: 0.77rem;
  font-weight: 700;
}

.attachments-file-browser-dialog .attachments-file-folder-content {
  padding: 12px 14px 14px;
  gap: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: var(--color-surface-subtle);
}

.attachments-file-browser-dialog .attachments-file-document-group {
  margin-left: 0;
  padding: 0;
  border-color: rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.attachments-file-browser-dialog .attachments-file-document-header {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: var(--color-surface);
}

.attachments-file-browser-dialog .attachments-file-document-name {
  min-width: 0;
  overflow: hidden;
  color: var(--color-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-file-browser-dialog .attachments-file-rows {
  gap: 0;
  padding: 0;
}

.attachments-file-browser-dialog .attachments-file-row {
  grid-template-columns: minmax(220px, 2fr) 118px 70px 168px 162px 152px;
  align-items: center;
  min-height: 50px;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 0;
  cursor: pointer;
}

.attachments-file-browser-dialog .attachments-file-row:nth-child(even) {
  background: transparent;
}

.attachments-file-browser-dialog .attachments-file-row + .attachments-file-row {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.attachments-file-browser-dialog .attachments-file-row:hover {
  background: rgba(37, 99, 235, 0.05);
}

.attachments-file-browser-dialog .attachments-file-row.is-selected {
  background: rgba(37, 99, 235, 0.1);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.attachments-file-browser-dialog .attachments-file-cell {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-file-browser-dialog .attachments-file-name-text,
.attachments-file-browser-dialog .attachments-file-card-title {
  min-width: 0;
  overflow: hidden;
  color: var(--color-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-file-browser-dialog .attachments-file-subtle {
  font-size: 0.74rem;
}

.attachments-file-browser-dialog .attachments-file-badge {
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.attachments-file-browser-dialog .attachments-file-row-actions {
  justify-content: flex-end;
  opacity: 1;
  pointer-events: auto;
}

.attachments-file-browser-dialog .attachments-file-row-actions button,
.attachments-file-browser-dialog .attachments-file-card-actions button {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  border-color: rgba(148, 163, 184, 0.28);
  font-weight: 700;
}

.attachments-file-browser-dialog .attachments-file-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  padding: 12px;
}

.attachments-file-browser-dialog .attachments-file-card {
  min-height: 126px;
  padding: 12px;
  border-color: rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  box-shadow: none;
}

.attachments-file-browser-dialog .attachments-file-card:hover,
.attachments-file-browser-dialog .attachments-file-card:focus-within {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
}

.attachments-file-browser-dialog .attachments-file-card-header {
  align-items: flex-start;
}

.attachments-file-browser-dialog .attachments-file-card-actions {
  margin-top: auto;
}

.attachments-file-browser-dialog .attachments-file-empty,
.attachments-file-browser-dialog .attachments-file-loading {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 24px;
}

.attachments-file-browser-dialog .attachments-file-footer {
  flex: 0 0 auto;
  min-height: 32px;
  margin-top: -2px;
  padding: 0 2px;
}

.attachments-file-browser-dialog .attachments-file-footer p {
  margin: 0;
}

.attachments-file-browser-dialog .attachments-file-preview {
  min-width: 0;
  padding: var(--space-2);
  overflow: auto;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  background: var(--color-surface-subtle);
}

.attachments-file-browser-dialog .attachments-file-preview-header h4 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--color-heading);
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-file-browser-dialog .attachments-file-preview-meta {
  display: grid;
  gap: 8px;
}

.attachments-file-browser-dialog .attachments-file-preview-line {
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.attachments-file-browser-dialog .attachments-file-preview-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.attachments-file-browser-dialog .attachments-file-preview-actions button {
  min-width: 0;
}

.attachments-file-browser-dialog > .modal-actions {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--color-surface-subtle);
}

.attachments-file-browser-dialog > .modal-actions .secondary-button {
  min-width: 112px;
  min-height: 38px;
  border-radius: 10px;
}

@media (max-width: 1180px) {
  .attachments-file-browser-dialog.modal-dialog {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px);
  }

  .attachments-file-browser-dialog .attachments-file-browser {
    grid-template-columns: minmax(210px, 236px) minmax(0, 1fr) 0;
  }

  .attachments-file-browser-dialog .attachments-file-browser.has-preview {
    grid-template-columns: minmax(210px, 236px) minmax(0, 1fr) 300px;
  }

  .attachments-file-browser-dialog .attachments-file-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachments-file-browser-dialog .attachments-file-toolbar-right {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .attachments-file-browser-dialog .attachments-file-search {
    flex: 1 1 320px;
  }
}

@media (max-width: 900px) {
  .attachments-file-browser-dialog .attachments-file-browser,
  .attachments-file-browser-dialog .attachments-file-browser.has-preview {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .attachments-file-browser-dialog .attachments-file-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  }

  .attachments-file-browser-dialog .attachments-file-preview {
    max-height: 240px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    border-left: 0;
  }
}

@media (max-width: 768px) {
  #attachmentsFileBrowserModal.is-visible {
    align-items: stretch;
    justify-content: center;
    padding: 0;
    overflow: hidden;
  }

  .attachments-file-browser-dialog.modal-dialog,
  .attachments-file-browser-dialog.modal-dialog.is-resizable {
    width: 100vw !important;
    max-width: 100vw !important;
    height: var(--modal-visual-viewport-height, 100dvh) !important;
    max-height: var(--modal-visual-viewport-height, 100dvh) !important;
    min-width: 0;
    min-height: 0;
    border-radius: 0;
  }

  .attachments-file-browser-dialog > .attachments-file-browser-body.modal-body {
    padding: 8px 8px 0;
  }

  .attachments-file-browser-dialog .attachments-file-sidebar {
    grid-template-columns: minmax(0, 1fr);
    max-height: 240px;
    padding: 12px;
  }

  .attachments-file-browser-dialog .attachments-file-date-range span {
    display: none;
  }

  .attachments-file-browser-dialog .attachments-file-browser .attachments-file-main {
    padding: 12px;
  }

  .attachments-file-browser-dialog .attachments-file-toolbar-left,
  .attachments-file-browser-dialog .attachments-file-toolbar-right,
  .attachments-file-browser-dialog .attachments-file-path,
  .attachments-file-browser-dialog .attachments-file-search,
  .attachments-file-browser-dialog .attachments-file-search input,
  .attachments-file-browser-dialog .attachments-file-toolbar select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .attachments-file-browser-dialog .attachments-file-list {
    min-width: 760px;
  }

  .attachments-file-browser-dialog .attachments-file-preview-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachments-file-browser-dialog > .modal-actions {
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

.attachments-note-review-issue {
  display: grid;
  gap: 8px;
  margin: 16px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.94);
}

.attachments-note-review-field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.attachments-note-review-field select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  padding: 6px 8px;
}

.attachments-note-review-checkbox {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
  row-gap: 0;
  padding-top: 2px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text);
  cursor: pointer;
}

.attachments-note-review-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: #2563eb;
  justify-self: center;
  flex: 0 0 auto;
}

.attachments-note-review-checkbox span {
  display: block;
  min-width: 0;
}

.attachments-pdf-panel-item-issue {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 7px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.resubmit-review-issues {
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.8);
}

section.resubmit-review-issues:not(.tab-pane):not(.settings-hub) {
  display: flex;
}

.resubmit-review-issues__head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.resubmit-review-issues__head h4 {
  margin: 0 0 3px;
  font-size: 14px;
}

.resubmit-review-issues__summary {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.resubmit-review-issues__actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.resubmit-review-issues__actions .secondary-button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.2;
}

.resubmit-review-issues__list {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 0 1 auto;
  height: auto;
  max-height: 260px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.resubmit-review-issues__list > .muted {
  margin: 0;
}

.review-process-review-issues .resubmit-review-issues__list {
  max-height: 220px;
}

.review-process-assignment-state {
  display: none !important;
}

.resubmit-assignment-state {
  display: none !important;
}

#resubmitModal .modal-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.resubmit-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
}

.resubmit-action-panel {
  display: flex;
  align-self: start;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  scrollbar-width: thin;
}

.resubmit-action-panel__head h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.resubmit-action-panel label {
  margin: 0;
  color: var(--color-heading);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.resubmit-action-panel select,
.resubmit-action-panel textarea {
  width: 100%;
  min-width: 0;
  border: 1.25px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  font: inherit;
}

.resubmit-action-panel select {
  min-height: 38px;
  padding: 0 10px;
  text-overflow: ellipsis;
}

#modalResubmitCommitInput {
  flex: 0 0 auto;
  height: 132px;
  min-height: 118px;
  max-height: none;
  padding: 10px 11px;
  line-height: 1.4;
  resize: vertical;
  margin-top: 8px;
  margin-bottom: 8px;
}

.resubmit-updated-files {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.82);
}

.resubmit-updated-files__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.resubmit-updated-files__head h5 {
  margin: 0;
  color: var(--color-heading);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
}

.resubmit-updated-files__count {
  flex: 0 0 auto;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  white-space: nowrap;
}

.resubmit-updated-files__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.resubmit-updated-files__list > p {
  margin: 0;
}

.resubmit-updated-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: calc(var(--radius-md) - 2px);
  background: rgba(255, 255, 255, 0.94);
}

.resubmit-updated-file__main {
  min-width: 0;
}

.resubmit-updated-file__name {
  display: block;
  overflow: hidden;
  color: var(--color-heading);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resubmit-updated-file__meta {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resubmit-updated-file__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  white-space: nowrap;
}

.resubmit-updated-file__badge.is-new {
  color: #15803d;
}

.resubmit-updated-files__more {
  margin: 0;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.35;
}

#resubmitModal .resubmit-action-buttons {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(128px, 0.85fr);
  gap: 10px;
  position: relative;
  bottom: auto;
  z-index: 2;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.98),
    rgba(255, 255, 255, 0.94)
  );
}

#resubmitModal .resubmit-action-buttons button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  justify-content: center;
  white-space: nowrap;
}

#resubmitModal .resubmit-action-buttons #modalCancelAnnouncementButton {
  grid-column: 1 / -1;
}

#resubmitReviewIssuesPanel {
  flex: 1 1 0;
  min-height: min(220px, 32vh);
  margin: 0;
}

#reviewProcessReviewIssuesPanel {
  flex: 1 1 0;
  min-height: 180px;
}

#resubmitReviewIssuesPanel .resubmit-review-issues__list,
#reviewProcessReviewIssuesPanel .resubmit-review-issues__list {
  flex: 1 1 auto;
  height: 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-width: thin;
}

.resubmit-review-issues.is-workbench-entry .resubmit-review-issue__response {
  display: none;
}

.resubmit-review-issues.is-workbench-entry .resubmit-review-issue {
  align-items: start;
}

.resubmit-review-issues.is-workbench-entry .resubmit-review-issue__comment {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.review-issue-workbench-dialog {
  width: min(1180px, calc(100vw - 48px));
  height: min(820px, calc(var(--modal-visual-viewport-height, 100dvh) - 48px));
  max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 48px);
}

.review-issue-workbench-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.review-issue-workbench-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.86);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 800;
}

.review-issue-workbench-summary__text {
  min-width: 0;
}

.review-issue-workbench-summary__refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-primary);
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.review-issue-workbench-summary__refresh:hover:not(:disabled),
.review-issue-workbench-summary__refresh:focus-visible:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(239, 246, 255, 0.95);
}

.review-issue-workbench-summary__refresh:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.review-issue-workbench-summary__refresh svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.review-issue-workbench-layout {
  display: grid;
  grid-template-columns: minmax(240px, 32%) minmax(0, 1fr);
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}

.review-issue-workbench-list,
.review-issue-workbench-detail {
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
}

.review-issue-workbench-list {
  padding: 8px;
}

.review-issue-workbench-list__inner {
  display: grid;
  gap: 8px;
}

.review-issue-workbench-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.72);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.review-issue-workbench-item.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.review-issue-workbench-item__title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-issue-workbench-item__meta,
.review-issue-workbench-item__status {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.review-issue-workbench-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.review-issue-workbench-detail__header {
  display: grid;
  gap: 6px;
  padding: 2px 2px 0;
}

.review-issue-workbench-detail__header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.review-issue-workbench-detail__header h4 {
  margin: 0;
  min-width: 0;
  font-size: 16px;
  line-height: 1.3;
}

.review-issue-workbench-detail__file {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.review-issue-workbench-detail__meta {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.review-issue-workbench-detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 0 auto;
}

.review-issue-workbench-detail__comment {
  margin: 0;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.45;
}

.review-issue-workbench-detail__section {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.review-issue-workbench-detail__section-title {
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.review-issue-workbench-detail__section--annotation {
  gap: 12px;
}

.review-issue-workbench-detail__section--primary {
  border-color: rgba(37, 99, 235, 0.16);
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.96) 0%,
    rgba(255, 255, 255, 1) 42%
  );
}

.review-issue-workbench-detail__section--footer {
  margin-top: auto;
  background: rgba(248, 250, 252, 0.82);
}

.review-issue-workbench-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.review-issue-workbench-detail__actions .secondary-button,
.review-issue-workbench-detail__actions .primary-button,
.review-issue-workbench-detail__actions .danger-button {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}

.review-issue-workbench-detail__info-grid {
  display: grid;
  grid-template-columns: minmax(116px, 28%) minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
}

.review-issue-workbench-detail__info-grid dt,
.review-issue-workbench-detail__info-grid dd {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.review-issue-workbench-detail__info-grid dt {
  color: var(--color-text-muted);
  font-weight: 800;
}

.review-issue-workbench-detail__info-grid dd {
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-weight: 700;
}

.review-issue-workbench-detail__swatch-value {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.review-issue-workbench-detail__swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
}

.review-issue-workbench-detail__quote-preview {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-left: 4px solid var(--color-primary);
  background: rgba(239, 246, 255, 0.56);
}

.review-issue-workbench-detail__quote-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
}

.review-issue-workbench-detail__quote-toolbar > span {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 800;
}

.review-issue-workbench-detail__quote-preview p {
  margin: 0;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.55;
}

.review-issue-workbench-detail__quote-preview mark {
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(250, 204, 21, 0.38);
  color: inherit;
  font-weight: 800;
}

.review-issue-workbench-detail__quote-preview
  .review-issue-workbench-detail__quote-empty {
  color: var(--color-text-muted);
  font-weight: 600;
}

.review-issue-workbench-detail__info {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.review-issue-workbench-detail__info-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 0px;
}

.review-issue-workbench-detail__info-button:hover,
.review-issue-workbench-detail__info-button:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
  outline: none;
}

.review-issue-workbench-detail__info-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  display: none;
  width: min(320px, calc(100vw - 96px));
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.review-issue-workbench-detail__info:hover
  .review-issue-workbench-detail__info-popover,
.review-issue-workbench-detail__info:focus-within
  .review-issue-workbench-detail__info-popover {
  display: block;
}

.review-issue-workbench-detail__info-popover
  .review-issue-workbench-detail__info-grid {
  grid-template-columns: minmax(84px, 32%) minmax(0, 1fr);
}

.review-issue-workbench-detail__request {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.review-issue-workbench-detail__request-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-issue-workbench-detail__request-title {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.review-issue-attempt-overview {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.62);
}

.review-issue-attempt-overview__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-issue-attempt-overview__head > strong {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.review-issue-attempt-overview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: 6px;
  background: #fff;
}

.review-issue-attempt-overview__node {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(37, 99, 235, 0.34);
  background: #fff;
}

.review-issue-attempt-overview__node + .review-issue-attempt-overview__node {
  border-left-color: rgba(37, 99, 235, 0.34);
  box-shadow: inset 1px 0 0 rgba(226, 232, 240, 0.82);
}

.review-issue-attempt-overview__node span {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.review-issue-attempt-overview__node strong {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-issue-attempt-overview__file-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--color-primary);
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.review-issue-attempt-overview__file-link:hover,
.review-issue-attempt-overview__file-link:focus-visible {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.review-issue-attempt-overview__node em {
  color: var(--color-text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.review-issue-attempt-overview__file-meta {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.review-issue-attempt-overview__feedback {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border-left: 3px solid rgba(217, 119, 6, 0.5);
  background: rgba(255, 251, 235, 0.72);
}

.review-issue-attempt-overview__feedback-head,
.review-issue-attempt-overview__specialist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-issue-attempt-overview__feedback strong,
.review-issue-attempt-overview__specialist-response strong,
.review-issue-attempt-overview__timeline-head strong {
  color: var(--color-text);
  font-size: 12px;
  font-weight: 900;
}

.review-issue-attempt-overview__feedback p,
.review-issue-attempt-overview__specialist-response p,
.review-issue-attempt-overview__timeline-item p {
  margin: 0;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.4;
}

.review-issue-attempt-overview__feedback span,
.review-issue-attempt-overview__specialist-response > span,
.review-issue-attempt-overview__timeline-item small {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.review-issue-attempt-overview__specialist-response {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border-left: 3px solid rgba(37, 99, 235, 0.48);
  background: rgba(239, 246, 255, 0.78);
}

.review-issue-attempt-overview > .resubmit-review-issue__version-actions {
  margin-top: -2px;
  padding-top: 0;
}

.review-issue-attempt-overview__history {
  display: grid;
  gap: 8px;
}

.review-issue-attempt-overview__history > summary {
  width: max-content;
  max-width: 100%;
  cursor: pointer;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.review-issue-attempt-overview__history > summary:hover {
  color: var(--color-primary-dark);
}

.review-issue-attempt-overview__timeline {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-issue-attempt-overview__timeline-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 0 0 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  border-left: 2px solid rgba(148, 163, 184, 0.34);
}

.review-issue-attempt-overview__timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

#reviewProcessModal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

#reviewProcessModalBody > #reviewProcessContent,
#reviewProcessMainSection {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

#reviewProcessModalBody > #reviewProcessContent {
  height: 100%;
  min-height: 0;
  gap: 12px;
}

#reviewProcessMainSection {
  gap: var(--space-3);
}

.review-process-main__head h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.25;
}

.review-process-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
}

.review-process-review-issues {
  min-height: 0;
  margin: 0;
}

.review-process-review-issues .resubmit-review-issues__list {
  flex: 1 1 auto;
  max-height: none;
}

.review-process-decision-panel {
  display: flex;
  align-self: start;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  scrollbar-width: thin;
}

.review-process-decision-panel__head h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.review-process-decision-panel label,
.review-process-decision-panel .score-selector-label {
  margin: 0;
  color: var(--color-heading);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.review-process-decision-panel textarea {
  flex: 0 0 auto;
  height: 132px;
  min-height: 118px;
  max-height: none;
}

.review-process-decision-panel .score-selector {
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  margin-left: 0;
  text-align: left;
}

.review-process-decision-panel .score-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.review-process-decision-panel .score-option {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 72px;
  padding: 7px 4px;
  text-align: center;
}

.review-process-decision-panel .score-option .score-option-value {
  width: 2.15rem;
  height: 2.15rem;
}

.review-process-decision-panel .score-option .score-option-label {
  position: static;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.15;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.review-process-decision-panel .score-option.is-selected .score-option-label,
.review-process-decision-panel .score-option[aria-pressed="true"] .score-option-label {
  color: var(--color-primary);
  opacity: 1;
  visibility: visible;
}

.review-process-decision-panel .review-actions-row {
  display: block;
  margin-top: 4px;
}

.review-process-decision-panel .review-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.review-process-decision-panel .review-primary-actions button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  justify-content: center;
}

@media (max-width: 860px) {
  #resubmitModal .modal-body,
  #reviewProcessModal .modal-body {
    overflow-y: auto;
  }

  #submitModal[data-submit-mode="finalizeAnnouncement"] .modal-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .resubmit-modal-layout,
  .review-process-layout {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  #submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-layout {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  #submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-card--entity,
  #submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-card--detail,
  .resubmit-action-panel,
  .review-process-decision-panel {
    align-self: stretch;
    max-height: none;
  }

  #submitModal[data-submit-mode="finalizeAnnouncement"] .submit-modal-card--detail {
    order: -1;
  }

  .resubmit-action-panel {
    order: -1;
  }

  #submitModal[data-submit-mode="finalizeAnnouncement"] #noteInput,
  #modalResubmitCommitInput,
  .review-process-decision-panel textarea {
    height: 120px;
    min-height: 120px;
  }
}

@media (max-width: 520px) {
  #submitModal[data-submit-mode="finalizeAnnouncement"] .modal-actions,
  #resubmitModal .resubmit-action-buttons {
    grid-template-columns: minmax(0, 1fr);
  }
}

.resubmit-review-issue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.resubmit-review-issue.is-handled {
  border-color: rgba(22, 163, 74, 0.34);
  background: rgba(240, 253, 244, 0.62);
}

.resubmit-review-issue.is-needs-revision {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(255, 251, 235, 0.68);
}

.review-process-review-issue.is-needs-revision {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(255, 251, 235, 0.68);
}

.resubmit-review-issue.is-closed,
.review-process-review-issue.is-closed {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(248, 250, 252, 0.78);
}

.resubmit-review-issue__main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.resubmit-review-issue__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text);
}

.resubmit-review-issue__meta {
  margin-top: 3px;
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resubmit-review-issue__comment {
  margin: 4px 0 0;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.resubmit-review-issue__response {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 6px;
  align-items: start;
}

.resubmit-review-issue__version-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.resubmit-review-issue__version-node {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  border-left: 3px solid var(--color-border);
  background: rgba(248, 250, 252, 0.7);
}

.resubmit-review-issue__version-node span {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.resubmit-review-issue__version-node strong {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resubmit-review-issue__version-file-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--color-primary);
  text-decoration: none;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.resubmit-review-issue__version-file-link:hover,
.resubmit-review-issue__version-file-link:focus-visible {
  text-decoration: underline;
}

.resubmit-review-issue__version-node em {
  color: var(--color-text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.resubmit-review-issue__version-file-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resubmit-review-issue__version-actions,
.review-process-review-issue__decision-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.resubmit-review-issue__version-actions .primary-button,
.resubmit-review-issue__version-actions .secondary-button,
.review-process-review-issue__decision-buttons .secondary-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.review-process-review-issue__decision .review-issue-lifecycle-button {
  width: fit-content;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.review-process-review-issue__decision-buttons .secondary-button.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.review-process-review-issue__response-summary {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 8px 9px;
  border-left: 3px solid rgba(37, 99, 235, 0.34);
  background: rgba(239, 246, 255, 0.68);
}

.resubmit-review-issue__director-decision {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 8px 9px;
  border-left: 3px solid rgba(217, 119, 6, 0.5);
  background: rgba(255, 251, 235, 0.86);
}

.review-process-review-issue__response-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--color-text);
  font-size: 12px;
}

.resubmit-review-issue__director-decision-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--color-text);
  font-size: 12px;
}

.review-process-review-issue__response-message {
  margin: 0;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.4;
}

.resubmit-review-issue__director-decision-reason {
  margin: 0;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.4;
}

.review-process-review-issue__response-meta {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.review-process-review-issue__decision-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.resubmit-review-issue__director-decision-meta {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.resubmit-review-issue__field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.resubmit-review-issue__field select,
.resubmit-review-issue__field textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
}

.resubmit-review-issue__field select {
  min-height: 34px;
  padding: 6px 8px;
}

.resubmit-review-issue__field textarea {
  min-height: 58px;
  resize: vertical;
  padding: 7px 9px;
  line-height: 1.4;
}

.resubmit-review-issue__field-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.resubmit-review-issue__field-actions .secondary-button {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.resubmit-review-issue__field-save-status {
  min-height: 24px;
  white-space: nowrap;
}

.resubmit-review-issue__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 112px;
}

#resubmitReviewIssuesPanel.has-many-issues .resubmit-review-issue {
  gap: 8px;
  padding: 8px;
}

#resubmitReviewIssuesPanel.has-many-issues .resubmit-review-issue__comment {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#resubmitReviewIssuesPanel.has-many-issues .resubmit-review-issue__field textarea {
  min-height: 48px;
}

@media (max-width: 720px) {
  #resubmitModal .modal-dialog,
  .resubmit-modal-dialog {
    width: calc(100vw - 24px);
    height: calc(var(--modal-visual-viewport-height, 100dvh) - 24px);
    min-height: 0;
    max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 24px);
  }

  .review-issue-workbench-dialog {
    width: calc(100vw - 24px);
    height: calc(var(--modal-visual-viewport-height, 100dvh) - 24px);
    max-height: calc(var(--modal-visual-viewport-height, 100dvh) - 24px);
  }

  .review-issue-workbench-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-issue-workbench-list {
    max-height: 34vh;
  }

  .resubmit-review-issues__head,
  .resubmit-review-issue {
    grid-template-columns: minmax(0, 1fr);
  }

  .resubmit-review-issue__response {
    grid-template-columns: minmax(0, 1fr);
  }

  .resubmit-review-issue__version-flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .resubmit-review-issues__head {
    display: grid;
  }

  .resubmit-review-issue__side {
    align-items: flex-start;
    min-width: 0;
  }
}

/* Modal header cursor normalization */
.modal-dialog .modal-header.modal-window-header,
.modal-dialog.attachments-window-dialog .modal-header.attachments-window-header,
.attachments-preview-modal .modal-dialog.attachments-preview-dialog--compact .modal-header {
  cursor: grab;
}

.modal-dialog .modal-header.modal-window-header:active,
.modal-dialog.attachments-window-dialog .modal-header.attachments-window-header:active,
.attachments-preview-modal .modal-dialog.attachments-preview-dialog--compact .modal-header:active {
  cursor: grabbing;
}

.modal-dialog .modal-header.modal-window-header
  :where(.modal-title-block, .attachments-preview-header-side) {
  cursor: inherit;
}

.modal-dialog .modal-header.modal-window-header
  :where(
    button,
    a,
    input,
    select,
    textarea,
    label,
    [role="button"],
    [data-no-drag],
    .modal-header-actions,
    .attachments-preview-toolbar,
    .attachments-preview-toolbar *
  ) {
  cursor: auto;
}

.modal-dialog .modal-header.modal-window-header
  :where(button, a, label, [role="button"], .modal-close, .modal-minimize-dot) {
  cursor: pointer;
}
