body {
  background: var(--sek-canvas);
  background-attachment: scroll;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

.simple-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 64px;
}

.simple-header,
.landing-header {
  min-height: var(--sek-header-height);
  padding: 0 max(24px, calc((100vw - var(--sek-content-width)) / 2));
  color: #ffffff;
  background: var(--sek-ink);
  border-bottom: 1px solid #090806;
}

.simple-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: stretch;
  gap: 24px;
}

.secretarium-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.secretarium-wordmark {
  color: #ffffff;
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}

.secretarium-wordmark span,
.landing-brand-title span {
  color: var(--sek-brand-red);
}

.secretarium-product-note {
  max-width: 190px;
  color: #aaa69e;
  font-size: 11px;
  line-height: 1.25;
}

.shell-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.shell-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 112px;
  padding: 0 20px;
  color: #c6c3bd;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-decoration: none;
  justify-content: center;
}

.shell-nav-link:hover,
.shell-nav-link.is-active {
  color: #ffffff;
  background: #211e1a;
}

.shell-nav-link.is-active::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 3px;
  content: "";
  background: var(--sek-gold);
}

.header-actions {
  justify-content: flex-end;
  align-self: center;
  flex-wrap: nowrap;
  padding: 0;
}

.simple-header .runtime-badge {
  min-height: 32px;
  padding: 0 10px;
  color: #bbb7af;
  background: transparent;
  border-color: var(--sek-line-dark);
  border-radius: var(--sek-radius);
  box-shadow: none;
  font-size: 11px;
}

.simple-header .runtime-badge.gpu,
.simple-header .runtime-badge.cpu {
  color: #d6d2ca;
  background: transparent;
  border-color: var(--sek-line-dark);
}

.simple-header .runtime-badge.offline {
  color: #ffb3ac;
  background: transparent;
  border-color: #753a35;
}

.simple-header .user-chip {
  min-height: 38px;
  padding: 4px 11px 4px 5px;
  color: #ffffff;
  background: transparent;
  border-color: var(--sek-line-dark);
  border-radius: var(--sek-radius);
  box-shadow: none;
}

.simple-header .user-chip:hover {
  background: #28241f;
  box-shadow: none;
  transform: none;
}

.simple-header .user-avatar {
  border-radius: 4px;
  background: var(--sek-burgundy);
  box-shadow: none;
}

.simple-header .legacy-link {
  min-height: 34px;
  padding: 0 12px;
  color: #d8d4cc;
  background: transparent;
  border-color: var(--sek-line-dark);
  border-radius: var(--sek-radius);
  box-shadow: none;
  font-size: 12px;
}

.simple-header .legacy-link:hover {
  color: #ffffff;
  background: #28241f;
  box-shadow: none;
  transform: none;
}

.simple-main {
  width: min(var(--sek-content-width), calc(100% - 48px));
  margin: 28px auto 0;
}

.upload-panel,
.jobs-panel,
.auth-card {
  border-radius: var(--sek-radius);
  box-shadow: var(--sek-shadow);
}

.upload-panel {
  top: calc(var(--sek-header-height) + 18px);
}

#documentsSection:focus {
  outline: none;
}

.auth-screen {
  width: 100%;
  margin: 0;
  padding: 0 0 46px;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.landing-brand-mark {
  width: 7px;
  height: 36px;
  border-radius: 0;
  background: var(--sek-gold);
  box-shadow: none;
}

.landing-brand-title {
  color: #ffffff;
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0;
}

.landing-brand-sub {
  color: #aaa69e;
}

.landing-header .secondary-btn,
.landing-header .primary-btn {
  min-height: 36px;
  border-radius: var(--sek-radius);
  box-shadow: none;
}

.landing-header .secondary-btn {
  color: #ffffff;
  background: transparent;
  border-color: var(--sek-line-dark);
}

.landing-header .primary-btn {
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
}

.landing-main {
  width: min(var(--sek-content-width), calc(100% - 48px));
  margin: 0 auto;
}

.landing-eyebrow {
  color: var(--sek-burgundy);
  letter-spacing: 0;
}

.landing-copy h1 {
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.auth-head h2 {
  margin: 0;
  color: var(--sek-ink);
  font-size: 24px;
  letter-spacing: 0;
}

.auth-logo {
  color: var(--sek-burgundy);
  border-color: rgba(123, 34, 48, 0.24);
  border-radius: var(--sek-radius);
}

.landing-main .primary-btn,
.auth-card .primary-btn {
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
  box-shadow: none;
}

.landing-main .primary-btn:hover:not(:disabled),
.auth-card .primary-btn:hover:not(:disabled) {
  background: var(--sek-burgundy-hover);
  border-color: var(--sek-burgundy-hover);
}

@media (max-width: 980px) {
  .simple-header {
    grid-template-columns: minmax(200px, 1fr) auto;
  }

  .shell-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 44px;
    margin: 0 -24px;
    padding: 0 24px;
    border-top: 1px solid #302c27;
  }

  .shell-nav-link {
    min-width: 110px;
  }

  .simple-main {
    margin-top: 22px;
  }
}

@media (max-width: 680px) {
  :root {
    --sek-header-height: 64px;
  }

  .simple-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 12px;
    padding: 0 14px;
  }

  .secretarium-product-note,
  .simple-header .runtime-badge,
  .simple-header .legacy-link {
    display: none;
  }

  .secretarium-wordmark {
    font-size: 22px;
  }

  .shell-nav {
    width: calc(100% + 28px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 -14px;
    padding: 0 6px;
    overflow-x: visible;
  }

  .shell-nav-link {
    min-width: 0;
    padding: 0 4px;
    font-size: 11px;
  }

  .shell-nav-link.is-active::after {
    right: 8px;
    left: 8px;
  }

  .simple-main,
  .landing-main {
    width: min(100% - 24px, var(--sek-content-width));
  }

  .landing-header {
    align-items: center;
    flex-direction: row;
    padding: 12px;
  }

  .landing-brand-sub {
    display: none;
  }

  .landing-nav {
    width: auto;
    flex-wrap: nowrap;
  }

  .landing-nav .secondary-btn,
  .landing-nav .primary-btn {
    width: auto;
    padding: 0 10px;
    font-size: 12px;
  }
}

/* Production workspace: target visual language on top of the existing job model. */
html,
body,
.simple-shell {
  overflow-x: clip;
}

body {
  color: var(--sek-ink);
  background: var(--sek-paper);
}

.simple-header {
  padding: 0 max(22px, calc((100vw - 1440px) / 2 + 22px));
}

.secretarium-wordmark {
  font-size: 19px;
  text-transform: uppercase;
}

.simple-header .runtime-badge {
  display: none;
}

.simple-header .user-chip {
  min-width: 250px;
  gap: 10px;
  padding: 0 0 0 16px;
  border: 0;
  border-left: 1px solid var(--sek-line-dark);
}

.simple-header .user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: var(--sek-success);
}

.user-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.simple-header .user-name {
  max-width: 116px;
  color: #f4f0e8;
  font-size: 13px;
}

.simple-header .header-billing-label {
  color: #bbb5aa;
  font-size: 10px;
}

.simple-header .header-billing-track {
  background: #3b3731;
}

.simple-header .header-billing-bar {
  background: var(--sek-gold);
}

.simple-header .header-billing-compact.is-unlimited .header-billing-bar {
  background: #6ea37f;
}

.simple-header .header-billing-compact.is-warning .header-billing-bar {
  background: #d09c42;
}

.simple-header .header-billing-compact.is-critical .header-billing-bar {
  background: #cf6258;
}

.user-role {
  max-width: 170px;
  margin-top: 3px;
  overflow: hidden;
  color: #958f84;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-main {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  width: min(1600px, 100%);
  margin: 0 auto;
}

.workspace-content {
  min-width: 0;
  padding: 0 36px 64px;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 31px 0 25px;
  border-bottom: 2px solid var(--sek-ink);
}

.workspace-kicker {
  margin-bottom: 5px;
  color: var(--sek-burgundy);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace-heading h1 {
  margin: 0;
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}

.workspace-heading p {
  margin-top: 5px;
  color: var(--sek-muted);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--sek-burgundy);
  border: 1px solid var(--sek-burgundy);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
}

.workspace-primary-btn:hover {
  background: var(--sek-burgundy-hover);
  border-color: var(--sek-burgundy-hover);
}

.workspace-primary-btn.is-open {
  color: var(--sek-burgundy);
  background: transparent;
  border-color: rgba(123, 34, 48, 0.42);
}

body[data-initial-view="processing"] #uploadSection {
  display: none;
}

.upload-panel {
  position: static;
  margin: 24px 0 28px;
  padding: 0;
  overflow: visible;
  background: #f3efe5;
  border: 1px solid #c9bfac;
  border-top: 3px solid var(--sek-burgundy);
  border-radius: 3px;
  box-shadow: 0 12px 30px rgba(23, 21, 18, 0.07);
}

.upload-band-main {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(500px, 1.55fr);
  align-items: center;
  gap: 30px;
  padding: 20px;
}

.upload-copy h2 {
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: 0;
}

.upload-copy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.upload-kicker {
  margin-bottom: 4px;
  color: var(--sek-burgundy);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.upload-close-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  padding: 0;
  color: var(--sek-muted);
  background: rgba(255, 254, 250, 0.7);
  border: 1px solid var(--sek-line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.upload-close-btn:hover {
  color: #ffffff;
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
}

.upload-copy p {
  margin-top: 5px;
  color: var(--sek-muted);
  font-size: 13px;
}

.upload-controls {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.upload-retention-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 9px 11px;
  color: #655e53;
  background: rgba(255, 254, 250, 0.62);
  border-left: 3px solid var(--sek-gold);
  font-size: 11px;
  line-height: 1.5;
}

.upload-proceeding-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--sek-muted);
  font-size: 11px;
}

.upload-proceeding-field span {
  white-space: nowrap;
}

.upload-proceeding-field strong {
  color: var(--sek-burgundy);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-proceeding-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  color: var(--sek-ink);
  background: #fffefa;
  border: 1px solid var(--sek-line);
  border-radius: 3px;
  font: inherit;
}

.dropzone {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 9px 10px;
  color: var(--sek-ink);
  text-align: left;
  background: rgba(255, 254, 250, 0.72);
  border: 1px solid var(--sek-line);
  border-radius: 3px;
  box-shadow: none;
}

.dropzone:hover,
.dropzone.dragover {
  background: #fffefa;
  border-color: var(--sek-gold);
  box-shadow: none;
  transform: none;
}

.dropzone-icon {
  width: 36px;
  height: 36px;
  margin: 0;
  color: var(--sek-burgundy);
  background: transparent;
  border: 1px solid var(--sek-line);
  border-radius: 3px;
  box-shadow: none;
}

.dropzone-icon svg {
  width: 20px;
  height: 20px;
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  box-shadow: none;
  transform: none;
}

.dropzone-text {
  min-width: 0;
}

.dropzone-main {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.dropzone-hint {
  margin-top: 1px;
  color: var(--sek-muted);
  font-size: 10.5px;
}

.dropzone-file {
  width: auto;
  max-width: 100%;
  margin: 2px 0 0;
  padding: 0;
  overflow: hidden;
  color: var(--sek-burgundy);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone .secondary-btn,
.submit-row .primary-btn,
.case-sources-row .secondary-btn {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 3px;
  box-shadow: none;
  font-size: 12px;
}

.dropzone .secondary-btn,
.case-sources-row .secondary-btn {
  color: var(--sek-ink);
  background: #fffefa;
  border-color: var(--sek-line);
}

.submit-row {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}

.submit-row .primary-btn {
  min-width: 174px;
  color: #ffffff;
  background: var(--sek-ink);
  border-color: var(--sek-ink);
}

.submit-row .primary-btn:hover:not(:disabled) {
  background: var(--sek-ink-soft);
  border-color: var(--sek-ink-soft);
  box-shadow: none;
  transform: none;
}

.submit-status {
  max-width: 190px;
  color: var(--sek-muted);
  font-size: 10.5px;
  line-height: 1.25;
}

.upload-materials {
  border-top: 1px solid var(--sek-line);
}

.upload-materials > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  color: var(--sek-burgundy);
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.upload-materials > summary::-webkit-details-marker {
  display: none;
}

.upload-materials > summary::before {
  content: "+";
  width: 14px;
  font-size: 16px;
  font-weight: 400;
}

.upload-materials[open] > summary::before {
  content: "−";
}

.upload-materials > summary small {
  color: var(--sek-muted);
  font-size: 10.5px;
  font-weight: 400;
}

.case-upload-block {
  margin: 0;
  padding: 18px 20px 22px;
  border-top: 1px solid var(--sek-line);
}

.case-section-head h3 {
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: 0;
}

.case-field input,
.case-field textarea,
.case-field select {
  color: var(--sek-ink);
  background: #fffefa;
  border-color: var(--sek-line);
  border-radius: 3px;
  box-shadow: none;
}

.case-field input:focus,
.case-field textarea:focus,
.case-field select:focus {
  outline: 2px solid rgba(123, 34, 48, 0.16);
  border-color: var(--sek-burgundy);
}

.case-autocomplete-menu {
  background: #fffefa;
  border-color: var(--sek-line-strong);
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(44, 40, 36, 0.16);
}

.case-autocomplete-menu button {
  color: var(--sek-ink);
  font-family: "PT Sans", Arial, sans-serif;
}

.case-autocomplete-menu button:hover,
.case-autocomplete-menu button:focus-visible {
  background: var(--sek-paper-dark);
}

.case-autocomplete-menu small {
  color: var(--sek-muted);
}

.case-input-state {
  color: var(--sek-muted);
  background: #f4f1e8;
  border-left-color: var(--sek-line-strong);
  border-radius: 0;
}

.case-input-state[data-status="pending"] {
  color: var(--sek-burgundy);
  border-left-color: var(--sek-burgundy);
}

.case-input-state[data-status="confirmed"],
.case-input-state[data-status="locked"] {
  color: #315f48;
  border-left-color: #315f48;
}

.case-input-action.case-input-pending {
  color: #fffefa;
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
}

.case-input-action.case-input-confirmed,
.case-input-action.case-input-locked {
  border-color: #557562;
}

.case-skip-btn {
  color: var(--sek-muted);
}

.modal-kicker {
  color: var(--sek-burgundy);
}

.modal-actions .primary-btn {
  color: #fffefa;
  background: var(--sek-ink);
  border-color: var(--sek-ink);
  box-shadow: none;
}

.modal-actions .primary-btn:hover:not(:disabled) {
  background: var(--sek-ink-soft);
  border-color: var(--sek-ink-soft);
  box-shadow: none;
  transform: none;
}

.cabinet-form-field input,
.cabinet-form-field select,
.cabinet-form-field textarea {
  color: var(--sek-ink);
  background: #fffefa;
  border-color: var(--sek-line);
  border-radius: 3px;
}

.jobs-panel {
  margin-top: 28px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.panel-head {
  align-items: flex-end;
  padding: 0 0 13px;
  background: transparent;
  border-bottom: 2px solid var(--sek-ink);
}

.panel-head h2 {
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 27px;
  letter-spacing: 0;
}

.panel-head p {
  margin-top: 3px;
  color: var(--sek-muted);
  font-size: 11px;
}

.panel-head-actions .secondary-btn,
.scope-btn {
  min-height: 32px;
  padding: 0 11px;
  color: var(--sek-ink);
  background: transparent;
  border: 1px solid var(--sek-line);
  border-radius: 3px;
  box-shadow: none;
  font-size: 11px;
}

.scope-toggle {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.scope-btn.is-active {
  color: #ffffff;
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
  box-shadow: none;
}

.record-owner-filter[hidden] {
  display: none;
}

.record-owner-filter select {
  min-width: 210px;
  height: 32px;
  padding: 0 30px 0 10px;
  color: var(--sek-ink);
  background: #fffefa;
  border: 1px solid var(--sek-line);
  border-radius: 3px;
  font-size: 11px;
}

.record-owner-filter select:focus {
  outline: 2px solid rgba(123, 34, 48, 0.14);
  border-color: var(--sek-burgundy);
}

.jobs-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 12px;
  background: #f2efe7;
  border-top: 1px solid var(--sek-line);
  border-bottom: 1px solid var(--sek-line);
}

.jobs-search {
  width: min(420px, 100%);
}

.jobs-search input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: var(--sek-ink);
  background: #fffefa;
  border: 1px solid var(--sek-line);
  border-radius: 3px;
  font-size: 12px;
}

.jobs-search input:focus {
  outline: 2px solid rgba(123, 34, 48, 0.14);
  border-color: var(--sek-burgundy);
}

.job-status-filter {
  display: flex;
  align-items: center;
  gap: 18px;
}

.job-status-filter button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--sek-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 11px;
}

.job-status-filter button span {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  color: var(--sek-muted);
  background: rgba(255, 254, 250, 0.78);
  border: 1px solid #d4ccbd;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8.5px;
  font-weight: 700;
}

.job-status-filter button.is-active span {
  color: #ffffff;
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
}

.job-status-filter button.is-active {
  color: var(--sek-burgundy);
  border-bottom-color: var(--sek-burgundy);
  font-weight: 700;
}

.job-status-filter[hidden],
.record-view-list[hidden],
.bulk-selection-bar[hidden] {
  display: none;
}

.trash-view-btn.is-active {
  color: #fff;
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
}

.bulk-selection-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid var(--sek-line);
}

.bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--sek-ink);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.bulk-select-all input,
.record-selector input {
  accent-color: var(--sek-burgundy);
}

.bulk-selected-count {
  flex: 1 1 auto;
  color: var(--sek-muted);
  font-size: 10.5px;
}

.bulk-jobs-action {
  min-height: 30px;
  padding: 0 11px;
  color: var(--sek-success);
  background: rgba(63, 114, 87, 0.07);
  border: 1px solid rgba(63, 114, 87, 0.28);
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
}

.bulk-jobs-action.danger {
  color: var(--sek-danger);
  background: rgba(183, 53, 43, 0.06);
  border-color: rgba(183, 53, 43, 0.24);
}

.bulk-jobs-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.jobs-list {
  min-height: 220px;
}

.jobs-column-head {
  display: grid;
  grid-template-columns: 42px minmax(210px, 1.15fr) minmax(170px, 0.72fr) minmax(330px, 1.35fr) 32px;
  gap: 16px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  color: #81786b;
  border-bottom: 1px solid var(--sek-line);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.job-row {
  display: grid;
  grid-template-columns: 42px minmax(210px, 1.15fr) minmax(170px, 0.72fr) minmax(330px, 1.35fr) 32px;
  align-items: center;
  gap: 10px 16px;
  min-height: 100px;
  padding: 14px 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sek-line);
}

.job-row.status-processing,
.job-row.status-canceling,
.job-row.status-queued,
.job-row.status-processing:hover,
.job-row.status-canceling:hover,
.job-row.status-queued:hover,
.job-row:hover {
  background: transparent;
  border-left: 0;
}

.job-row:hover {
  background: rgba(238, 236, 228, 0.52);
}

.job-row.status-processing,
.job-row.status-canceling,
.job-row.status-queued {
  box-shadow: inset 3px 0 0 rgba(185, 147, 66, 0.7);
}

.record-selector {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  cursor: pointer;
}

.record-selector input {
  position: absolute;
  z-index: 1;
  right: -1px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
}

.record-selector:focus-within .record-index {
  outline: 2px solid rgba(123, 34, 48, 0.18);
  outline-offset: 2px;
}

.record-selector input:checked + .record-index {
  color: #fff;
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
}

.record-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--sek-muted);
  background: #eeece4;
  border: 1px solid var(--sek-line);
  border-radius: 50%;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.job-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.job-title-line {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.job-title {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  color: var(--sek-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.rename-icon-btn {
  width: 24px;
  height: 24px;
  min-height: 24px;
  color: var(--sek-muted);
  border-radius: 3px;
}

.job-meta {
  margin-top: 5px;
  overflow: visible;
  color: var(--sek-muted);
  font-size: 10.5px;
  white-space: normal;
}

.owner-tag {
  min-height: 20px;
  padding: 1px 6px;
  color: var(--sek-muted);
  background: #eeece4;
  border-color: var(--sek-line);
  border-radius: 3px;
  box-shadow: none;
  font-size: 10px;
}

.job-state {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}

.status-pill {
  min-height: 0;
  padding: 0;
  color: var(--sek-muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 11px;
  font-weight: 400;
}

.status-pill::before {
  width: 5px;
  height: 5px;
}

.status-pill.processing,
.status-pill.queued,
.status-pill.canceling {
  color: #8a681f;
  background: transparent;
  border: 0;
}

.status-pill.done,
.status-pill.done_with_warnings {
  color: var(--sek-success);
  background: transparent;
  border: 0;
}

.status-pill.error,
.status-pill.canceled,
.status-pill.deleted_hidden {
  color: var(--sek-danger);
  background: transparent;
  border: 0;
}

.restore-job-btn {
  color: var(--sek-success);
  border-color: rgba(63, 114, 87, 0.32);
  background: rgba(63, 114, 87, 0.07);
}

.restore-job-btn:hover:not(:disabled) {
  color: #fff;
  background: var(--sek-success);
}

.job-stage,
.job-stage.is-error {
  margin-top: 5px;
  color: var(--sek-muted);
  font-size: 10.5px;
}

.job-stage.is-error {
  color: var(--sek-danger);
}

.job-error {
  margin-top: 6px;
  background: rgba(183, 53, 43, 0.06);
  border-color: rgba(183, 53, 43, 0.25);
  border-radius: 3px;
}

.job-error > summary {
  padding: 6px 8px;
  font-size: 10.5px;
}

.progress-shell {
  width: 100%;
  height: 4px;
  margin-top: 7px;
  background: #d7d3c8;
  border-radius: 0;
  box-shadow: none;
}

.progress-bar {
  background: var(--sek-gold);
  border-radius: 0;
  box-shadow: none;
}

.progress-caption {
  margin-top: 4px;
  color: var(--sek-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9.5px;
}

.job-progress-message {
  min-height: 30px;
  margin-top: 7px;
  color: #5f584d;
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.32;
}

.job-progress-message.is-humor {
  color: var(--sek-burgundy);
  font-style: italic;
}

.job-progress-fact {
  grid-column: 2 / 5;
  grid-row: 2;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  padding: 15px 18px;
  color: #5f584d;
  background:
    linear-gradient(90deg, rgba(185, 147, 66, 0.12), rgba(255, 254, 250, 0.68)),
    #f7f4ec;
  border: 1px solid #d8cfbd;
  border-left: 3px solid var(--sek-gold);
  border-radius: 0;
  box-shadow: none;
}

.job-progress-fact-kicker {
  padding-top: 2px;
  color: var(--sek-burgundy);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.job-progress-fact strong {
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.25;
}

.job-progress-fact p {
  margin-top: 4px;
  color: #5f584d;
  font-size: 11.5px;
  line-height: 1.48;
}

.job-actions {
  position: relative;
  grid-column: 4;
  grid-row: 1;
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.action-link,
.download-link,
.documents-main-btn,
.protocol-run-btn,
.protocol-download-btn,
.summary-run-btn,
.summary-download-btn {
  min-height: 32px;
  border-radius: 3px;
  box-shadow: none;
  font-size: 11px;
}

.summary-action-tip {
  display: inline-flex;
}

.action-link {
  color: var(--sek-ink);
  background: #fffefa;
  border-color: var(--sek-line);
}

.action-link:hover {
  background: #f0ede4;
  box-shadow: none;
  transform: none;
}

.record-open-action {
  color: #ffffff;
  background: var(--sek-ink);
  border-color: var(--sek-ink);
}

.record-open-action:hover {
  color: #ffffff;
  background: var(--sek-ink-soft);
}

.restart-job-btn {
  color: #ffffff;
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
}

.restart-job-btn:hover:not(:disabled) {
  color: #ffffff;
  background: var(--sek-burgundy-hover);
}

.documents-main-btn,
.documents-menu-trigger {
  color: var(--sek-ink);
  background: #fffefa;
  border-color: var(--sek-line);
  box-shadow: none;
}

.documents-main-btn {
  border-right: 0;
}

.documents-main-btn small,
.protocol-download-btn small {
  color: var(--sek-burgundy);
  background: #f0ede4;
  border-radius: 2px;
}

.documents-menu-trigger {
  border-left-color: var(--sek-line);
}

.documents-main-btn:hover,
.documents-menu-trigger:hover,
.job-documents-menu[open] .documents-menu-trigger {
  background: #f0ede4;
  box-shadow: none;
  filter: none;
  transform: none;
}

.protocol-run-btn {
  background: var(--sek-success);
  border-color: var(--sek-success);
  box-shadow: none;
}

.protocol-download-btn {
  color: var(--sek-success);
  background: rgba(63, 114, 87, 0.08);
  border-color: rgba(63, 114, 87, 0.32);
}

.summary-run-btn,
.summary-download-btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--sek-burgundy);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.summary-run-btn {
  color: #fff;
  background: var(--sek-burgundy);
  cursor: pointer;
}

.summary-run-btn:hover:not(:disabled) {
  color: #fff;
  background: var(--sek-burgundy-hover);
  border-color: var(--sek-burgundy-hover);
}

.summary-run-btn.is-locked {
  color: #8b877f;
  background: #e8e5de;
  border-color: #d0cbc1;
  cursor: not-allowed;
  opacity: 1;
}

.summary-run-btn.is-running {
  cursor: wait;
  opacity: 0.72;
}

.summary-download-btn {
  color: var(--sek-burgundy);
  background: rgba(123, 34, 48, 0.08);
  border-color: rgba(123, 34, 48, 0.3);
}

.summary-download-btn:hover {
  color: var(--sek-burgundy-hover);
  background: rgba(123, 34, 48, 0.13);
}

.summary-run-btn svg,
.summary-download-btn svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-download-btn small {
  color: var(--sek-burgundy);
  background: #f0e7e8;
  border-radius: 2px;
  font-size: 8.5px;
}

.process-summary-inline-status {
  color: var(--sek-burgundy);
}

.documents-popover {
  right: 0;
  background: #fffefa;
  border-color: var(--sek-line);
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(23, 21, 18, 0.14);
}

.delete-job-btn {
  position: static;
  grid-column: 5;
  grid-row: 1;
  width: 32px;
  height: 32px;
  min-height: 32px;
  color: var(--sek-muted);
  border-radius: 3px;
}

.delete-job-btn:hover:not(:disabled),
.delete-job-btn:focus-visible:not(:disabled) {
  color: var(--sek-danger);
  background: rgba(183, 53, 43, 0.08);
  border-color: rgba(183, 53, 43, 0.25);
}

.empty-state {
  padding: 52px 20px;
  color: var(--sek-muted);
  font-size: 13px;
}

.registry-empty-state {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 150px;
  padding: 30px 22px;
  background: #f7f4ec;
  border-bottom: 1px solid var(--sek-line);
}

.registry-empty-mark {
  width: 54px;
  height: 62px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--sek-burgundy);
  border: 1px solid #5d1722;
  box-shadow: inset 0 0 0 3px rgba(255, 254, 250, 0.12);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.registry-empty-state h3 {
  margin: 0;
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.registry-empty-state p {
  max-width: 600px;
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

#uploadSection:not([hidden]) + .jobs-panel .registry-empty-state {
  grid-template-columns: 58px minmax(0, 1fr);
}

#uploadSection:not([hidden]) + .jobs-panel .registry-empty-state .workspace-primary-btn {
  display: none;
}

.cabinet {
  max-width: calc(100vw - 24px);
}

@media (max-width: 1100px) {
  .upload-band-main {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .job-row {
    grid-template-columns: 42px minmax(0, 1fr) minmax(180px, 0.6fr) 32px;
  }

  .job-actions {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-content: flex-start;
  }

  .delete-job-btn {
    grid-column: 4;
  }

  .job-progress-fact {
    grid-column: 2 / 4;
    grid-row: 3;
  }

  .jobs-column-head {
    display: none;
  }
}

@media (max-width: 980px) {
  .simple-header {
    padding: 0 20px;
  }

  .simple-main {
    margin-top: 0;
  }

  .workspace-heading {
    padding-top: 24px;
  }
}

@media (max-width: 720px) {
  .workspace-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .workspace-primary-btn {
    align-self: flex-start;
  }

  .upload-controls {
    grid-template-columns: 1fr;
  }

  .upload-proceeding-field {
    grid-template-columns: 1fr;
  }

  .submit-row {
    align-items: flex-start;
  }

  .submit-row .primary-btn {
    min-width: 190px;
  }

  .jobs-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .jobs-search {
    width: 100%;
  }

  .job-status-filter {
    justify-content: space-between;
    gap: 10px;
  }

  .job-row {
    grid-template-columns: 36px minmax(0, 1fr) 32px;
    align-items: start;
    gap: 9px 12px;
    padding: 15px 0;
  }

  .record-index {
    width: 32px;
    height: 32px;
  }

  .job-main {
    grid-column: 2;
  }

  .job-state {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .job-actions {
    grid-column: 2 / 4;
    grid-row: 3;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .delete-job-btn {
    grid-column: 3;
    grid-row: 1;
  }

  .job-progress-fact {
    grid-column: 2 / 4;
    grid-row: 4;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 13px 14px;
  }

  .job-progress-fact p {
    font-size: 11px;
  }
}

@media (max-width: 680px) {
  .simple-header .user-chip {
    min-width: 42px;
    padding-left: 8px;
  }

  .simple-header .user-copy {
    display: none;
  }

  .protocol-run-btn {
    min-height: 44px;
    padding-right: 14px;
    padding-left: 14px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(63, 114, 87, 0.2);
  }

  .protocol-run-btn svg,
  .protocol-run-btn span {
    pointer-events: none;
  }

  .simple-main {
    width: min(100% - 28px, var(--sek-content-width));
  }

  .workspace-heading h1 {
    font-size: 28px;
  }

  .upload-panel {
    margin: 22px 0 28px;
  }

  .upload-band-main {
    padding: 16px;
  }

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

  .dropzone .secondary-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

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

  .case-field-wide {
    grid-column: 1;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .record-owner-filter {
    flex: 1 1 210px;
  }

  .record-owner-filter select {
    width: 100%;
  }

  .documents-popover {
    right: auto;
    left: 0;
    width: min(286px, calc(100vw - 72px));
  }
}

@media (max-width: 440px) {
  .job-status-filter {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .job-status-filter button {
    justify-self: stretch;
  }

  .job-actions {
    gap: 5px;
  }

  .protocol-download-btn-ghost,
  .documents-main-btn small,
  .protocol-download-btn small,
  .summary-download-btn small {
    display: none;
  }
}

/* Case register: the current data model groups records by their saved case number. */
.cases-sidebar {
  position: sticky;
  top: var(--sek-topbar-height);
  align-self: start;
  height: calc(100vh - var(--sek-topbar-height));
  min-width: 0;
  min-height: calc(100vh - var(--sek-header-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--sek-ink);
  background: #eeece4;
  border-right: 1px solid var(--sek-line);
}

.record-views {
  padding: 24px 18px 18px;
  background: #e5e1d8;
  border-bottom: 1px solid var(--sek-line);
}

.record-views-heading > span,
.cases-sidebar-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--sek-burgundy);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.record-views-heading h2 {
  margin: 0;
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.05;
}

.record-view-list {
  display: grid;
  gap: 4px;
  margin-top: 15px;
}

.record-view-item {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px 0 12px;
  color: #555047;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 11.5px;
}

.record-view-item:hover {
  color: var(--sek-ink);
  background: rgba(255, 254, 250, 0.56);
  border-color: rgba(198, 190, 177, 0.72);
}

.record-view-item strong {
  min-width: 23px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  color: var(--sek-muted);
  background: rgba(255, 254, 250, 0.66);
  border: 1px solid #d4ccbd;
  border-radius: 11px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8.5px;
  font-weight: 700;
}

.record-view-item.is-active {
  color: var(--sek-ink);
  background: #fffefa;
  border-color: #d6cfc2;
  box-shadow: inset 3px 0 0 var(--sek-burgundy);
  font-weight: 700;
}

.record-view-item.is-active strong {
  color: #fff;
  background: var(--sek-burgundy);
  border-color: var(--sek-burgundy);
}

.cases-sidebar-head {
  padding: 20px 18px 15px;
  border-bottom: 1px solid var(--sek-line);
}

.cases-sidebar-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.cases-sidebar-title h2 {
  margin: 0;
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
}

.cases-sidebar-title > span {
  color: var(--sek-muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.cases-search {
  display: block;
  margin-top: 14px;
}

.cases-search input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  color: var(--sek-ink);
  background: #fffefa;
  border: 1px solid var(--sek-line);
  border-radius: 3px;
  font-size: 11.5px;
}

.cases-search input:focus {
  outline: 2px solid rgba(123, 34, 48, 0.14);
  border-color: var(--sek-burgundy);
}

.case-list {
  min-width: 0;
}

.case-filter-item {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 14px 17px;
  color: var(--sek-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sek-line);
  border-left: 3px solid transparent;
  border-radius: 0;
}

.case-filter-item:hover {
  background: rgba(255, 254, 250, 0.5);
}

.case-filter-item.is-active {
  background: #fffefa;
  border-left-color: var(--sek-burgundy);
}

.case-filter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.case-filter-top strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-filter-top > span {
  flex: none;
  color: var(--sek-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9.5px;
}

.case-filter-subtitle {
  display: -webkit-box;
  min-height: 31px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--sek-muted);
  font-size: 10.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.case-filter-status {
  display: inline-block;
  margin-top: 8px;
  color: var(--sek-muted);
  font-size: 9.5px;
}

.case-filter-status::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  content: "";
  vertical-align: 1px;
  background: currentColor;
  border-radius: 50%;
}

.case-filter-status.active {
  color: #8a681f;
}

.case-filter-status.ready {
  color: var(--sek-success);
}

.case-filter-status.error {
  color: var(--sek-danger);
}

.case-filter-all {
  min-height: 76px;
}

.case-filter-empty {
  padding: 22px 20px;
  color: var(--sek-muted);
  font-size: 11.5px;
}

body[data-initial-view="processing"] .cases-sidebar {
  display: none;
}

body[data-initial-view="processing"] .simple-main {
  display: block;
  width: min(var(--sek-content-width), calc(100% - 48px));
}

body[data-initial-view="processing"] .workspace-content {
  padding: 0 0 64px;
}

body.trash-mode .simple-main {
  display: block;
  width: min(var(--sek-content-width), calc(100% - 48px));
}

body.trash-mode .workspace-content {
  padding: 0 0 64px;
}

/* Profile route: full user cabinet rather than a temporary slide-over. */
body[data-initial-view="profile"] .simple-shell {
  padding-bottom: 0;
}

body[data-initial-view="profile"] .simple-main,
body[data-initial-view="profile"] .cabinet-overlay {
  display: none;
}

body[data-initial-view="profile"] .cabinet {
  position: relative;
  inset: auto;
  z-index: auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 28px;
  width: min(var(--sek-content-width), calc(100% - 48px));
  max-width: none;
  margin: 0 auto 64px;
  padding: 0;
  overflow: visible;
  visibility: visible;
  color: var(--sek-ink);
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
  transition: none;
}

body[data-initial-view="profile"] .cabinet-head {
  grid-column: 1 / -1;
  display: block;
  padding: 30px 0 25px;
  border-bottom: 2px solid var(--sek-ink);
}

body[data-initial-view="profile"] .cabinet-close,
body[data-initial-view="profile"] #cabinetClose {
  display: none;
}

.cabinet-profile-kicker {
  margin-bottom: 13px;
  color: var(--sek-burgundy);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.cabinet-profile-subtitle {
  margin: 10px 0 0 60px;
  color: var(--sek-muted);
  font-size: 12.5px;
}

body[data-initial-view="profile"] .cabinet-id {
  gap: 13px;
}

body[data-initial-view="profile"] .cabinet-id .user-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  color: #ffffff;
  background: var(--sek-success);
  border-radius: 50%;
  box-shadow: none;
}

body[data-initial-view="profile"] .cabinet-name {
  max-width: min(720px, 70vw);
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}

body[data-initial-view="profile"] .cabinet-username {
  margin-top: 4px;
  color: var(--sek-muted);
  font-size: 11.5px;
}

body[data-initial-view="profile"] .cabinet-section {
  padding: 23px 0 28px;
  border-bottom: 1px solid var(--sek-line);
}

body[data-initial-view="profile"] .cabinet-section h3 {
  margin: 0 0 14px;
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
}

body[data-initial-view="profile"] .cabinet-section-head {
  align-items: baseline;
  margin-bottom: 14px;
}

body[data-initial-view="profile"] .cabinet-section-head h3 {
  margin: 0;
}

body[data-initial-view="profile"] .profile-stats-section,
body[data-initial-view="profile"] .profile-admin-section,
body[data-initial-view="profile"] .profile-template-section {
  grid-column: 1 / -1;
}

.case-field select,
.cabinet-form-field textarea {
  width: 100%;
  color: var(--sek-ink);
  background: #fffefa;
  border: 1px solid var(--sek-line);
  border-radius: 3px;
}

.case-field select {
  min-height: 40px;
  padding: 8px 10px;
}

.case-field small {
  color: var(--sek-muted);
  font-size: 11px;
}

.protocol-template-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 28px;
}

.protocol-template-list {
  display: grid;
  align-content: start;
  gap: 9px;
}

.protocol-template-card,
.protocol-template-empty {
  padding: 14px;
  background: #fffefa;
  border: 1px solid var(--sek-line);
  border-radius: 3px;
}

.protocol-template-card.is-default {
  border-left: 3px solid var(--sek-burgundy);
}

.protocol-template-card strong,
.protocol-template-card span {
  display: block;
}

.protocol-template-card span,
.protocol-template-empty {
  margin-top: 5px;
  color: var(--sek-muted);
  font-size: 12px;
  white-space: pre-line;
}

.protocol-template-card-actions,
.protocol-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.protocol-template-import-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: #fffefa;
  border: 1px dashed var(--sek-line);
  border-radius: 3px;
}

.protocol-template-import-row span {
  flex: 1 1 220px;
  color: var(--sek-muted);
  font-size: 11px;
  line-height: 1.45;
}

.cabinet-form-field textarea {
  min-height: 220px;
  padding: 10px;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}

.cabinet-form-field textarea.profile-directory-input {
  min-height: 104px;
}

.protocol-template-default-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sek-muted);
  font-size: 12px;
}

body[data-initial-view="profile"] .profile-notifications-section,
body[data-initial-view="profile"] .profile-sessions-section {
  grid-column: 1 / 8;
}

body[data-initial-view="profile"] .profile-settings-section,
body[data-initial-view="profile"] .profile-password-section {
  grid-column: 8 / -1;
  padding-left: 28px;
  border-left: 1px solid var(--sek-line);
}

body[data-initial-view="profile"] .stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--sek-line);
  border-bottom: 1px solid var(--sek-line);
}

body[data-initial-view="profile"] .stat-card {
  min-height: 88px;
  padding: 16px 18px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--sek-line);
  border-radius: 0;
  box-shadow: none;
}

body[data-initial-view="profile"] .stat-card:last-child {
  border-right: 0;
}

body[data-initial-view="profile"] .stat-value {
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

body[data-initial-view="profile"] .stat-label,
body[data-initial-view="profile"] .toggle-sub,
body[data-initial-view="profile"] .cabinet-note,
body[data-initial-view="profile"] .session-meta,
body[data-initial-view="profile"] .session-empty,
body[data-initial-view="profile"] .notification-meta,
body[data-initial-view="profile"] .notification-message {
  color: var(--sek-muted);
}

body[data-initial-view="profile"] .notification-row,
body[data-initial-view="profile"] .session-row,
body[data-initial-view="profile"] .notification-empty {
  padding: 11px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sek-line);
  border-radius: 0;
  box-shadow: none;
}

body[data-initial-view="profile"] .notification-row.unread {
  padding-left: 10px;
  border-left: 3px solid var(--sek-burgundy);
}

body[data-initial-view="profile"] .notification-row.warning.unread {
  border-left-color: #916b22;
}

body[data-initial-view="profile"] .notification-row.danger.unread {
  border-left-color: var(--sek-danger);
}

body[data-initial-view="profile"] .notification-group-head {
  border-color: var(--sek-line);
}

body[data-initial-view="profile"] .notification-row.category-support {
  padding: 12px 12px 12px 14px;
  background: #fffaf0;
  border: 1px solid rgba(123, 34, 48, 0.22);
  border-left: 4px solid rgba(123, 34, 48, 0.55);
}

body[data-initial-view="profile"] .notification-row.category-support.unread {
  background: #fff6df;
  border-left-color: var(--sek-burgundy);
  box-shadow: none;
}

body[data-initial-view="profile"] .session-badge {
  color: var(--sek-success);
  background: rgba(63, 114, 87, 0.1);
  border-radius: 2px;
}

body[data-initial-view="profile"] .secondary-btn,
body[data-initial-view="profile"] .cabinet-form input,
body[data-initial-view="profile"] .logout-btn {
  border-radius: 3px;
  box-shadow: none;
}

body[data-initial-view="profile"] .secondary-btn {
  color: var(--sek-ink);
  background: #fffefa;
  border-color: var(--sek-line);
}

body[data-initial-view="profile"] .cabinet-form input {
  color: var(--sek-ink);
  background: #fffefa;
  border-color: var(--sek-line);
}

body[data-initial-view="profile"] .toggle-track {
  background: #d7d3c8;
  box-shadow: inset 0 1px 3px rgba(23, 21, 18, 0.18);
}

body[data-initial-view="profile"] .toggle-input:checked + .toggle-track {
  background: var(--sek-burgundy);
}

body[data-initial-view="profile"] .logout-btn {
  grid-column: 8 / -1;
  align-self: start;
  min-height: 40px;
  margin: 22px 0 0 28px;
  color: var(--sek-danger);
  background: rgba(183, 53, 43, 0.05);
  border-color: rgba(183, 53, 43, 0.28);
}

body[data-initial-view="profile"] .logout-btn:hover {
  background: rgba(183, 53, 43, 0.09);
  box-shadow: none;
  transform: none;
}

@media (max-width: 1000px) {
  .simple-main {
    display: block;
    width: 100%;
  }

  .cases-sidebar {
    position: static;
    height: auto;
    min-height: 0;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--sek-line);
  }

  .cases-sidebar-head {
    display: grid;
    grid-template-columns: auto minmax(240px, 420px);
    align-items: end;
    gap: 24px;
    padding: 18px 24px 14px;
  }

  .record-views {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 24px;
    padding: 16px 24px;
  }

  .record-views-heading {
    min-width: 120px;
  }

  .record-views-heading h2 {
    font-size: 24px;
  }

  .record-view-list {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    gap: 7px;
    margin-top: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .record-view-item {
    min-width: 145px;
    background: rgba(255, 254, 250, 0.34);
  }

  .cases-search {
    margin-top: 0;
  }

  .case-list {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .case-filter-item {
    width: 230px;
    min-width: 230px;
    min-height: 86px;
    border-right: 1px solid var(--sek-line);
    border-bottom: 0;
    border-left: 0;
    border-top: 3px solid transparent;
  }

  .case-filter-item.is-active {
    border-top-color: var(--sek-burgundy);
  }

  .case-filter-all {
    min-height: 86px;
  }

  .workspace-content {
    padding: 0 24px 64px;
  }
}

@media (max-width: 850px) {
  body[data-initial-view="profile"] .profile-notifications-section,
  body[data-initial-view="profile"] .profile-sessions-section,
  body[data-initial-view="profile"] .profile-settings-section,
  body[data-initial-view="profile"] .profile-password-section,
  body[data-initial-view="profile"] .logout-btn {
    grid-column: 1 / -1;
  }

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

  body[data-initial-view="profile"] .profile-settings-section,
  body[data-initial-view="profile"] .profile-password-section {
    padding-left: 0;
    border-left: 0;
  }

  body[data-initial-view="profile"] .logout-btn {
    margin-left: 0;
  }
}

@media (max-width: 680px) {
  .secretarium-wordmark {
    font-size: 18px;
  }

  .cases-sidebar-head {
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 16px 14px 13px;
  }

  .record-views {
    display: block;
    padding: 14px;
  }

  .record-views-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .record-views-heading > span {
    margin: 0;
  }

  .record-views-heading h2 {
    font-size: 22px;
  }

  .record-view-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 11px;
    overflow-x: visible;
  }

  .record-view-item {
    min-width: 0;
  }

  .cases-sidebar-title h2 {
    font-size: 22px;
  }

  .case-filter-item {
    width: 210px;
    min-width: 210px;
  }

  .workspace-content {
    padding: 0 14px 56px;
  }

  .registry-empty-state {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 15px;
    padding: 24px 14px;
  }

  #uploadSection:not([hidden]) + .jobs-panel .registry-empty-state {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .registry-empty-mark {
    width: 46px;
    height: 54px;
  }

  .registry-empty-state .workspace-primary-btn {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  body[data-initial-view="processing"] .simple-main {
    width: calc(100% - 28px);
  }

  body[data-initial-view="processing"] .workspace-content {
    padding-right: 0;
    padding-left: 0;
  }

  body[data-initial-view="profile"] .cabinet {
    width: calc(100% - 28px);
    margin-bottom: 48px;
  }

  body[data-initial-view="profile"] .cabinet-head {
    padding: 23px 0 20px;
  }

  body[data-initial-view="profile"] .cabinet-name {
    max-width: none;
    overflow: visible;
    font-size: 25px;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .cabinet-profile-subtitle {
    margin-left: 0;
  }

  body[data-initial-view="profile"] .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-initial-view="profile"] .stat-card:nth-child(2) {
    border-right: 0;
  }

  body[data-initial-view="profile"] .stat-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--sek-line);
  }

  body[data-initial-view="profile"] .cabinet-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Personal cabinet navigation and focused panels. */
.profile-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.profile-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.profile-tab:hover,
.profile-tab.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.profile-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.profile-tab-badge {
  min-width: 18px;
  padding: 1px 5px;
  color: #fff;
  background: var(--danger);
  border-radius: 999px;
  font-size: 10px;
  line-height: 16px;
}

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

.profile-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: var(--text-3);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.profile-login-row strong {
  color: var(--text);
  font-weight: 650;
}

.profile-security-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 0 28px;
}

.profile-security-grid .logout-btn {
  grid-column: 1 / -1;
}

body[data-initial-view="profile"] .cabinet {
  display: block;
}

body[data-initial-view="profile"] .profile-tabs {
  margin: 18px 0 0;
  padding: 0;
  background: transparent;
  border-width: 0 0 1px;
  border-color: var(--sek-line);
  border-radius: 0;
}

body[data-initial-view="profile"] .profile-tab {
  position: relative;
  min-height: 44px;
  padding: 0 17px;
  color: var(--sek-muted);
  border-radius: 0;
  font-size: 12px;
}

body[data-initial-view="profile"] .profile-tab:hover,
body[data-initial-view="profile"] .profile-tab.is-active {
  color: var(--sek-ink);
  background: transparent;
  box-shadow: none;
}

body[data-initial-view="profile"] .profile-tab.is-active::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  content: "";
  background: var(--sek-burgundy);
}

body[data-initial-view="profile"] .profile-tab-panel {
  width: 100%;
}

body[data-initial-view="profile"] .profile-overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 28px;
}

body[data-initial-view="profile"] .profile-payment-status {
  grid-column: 1 / -1;
  margin-top: 24px;
  padding: 13px 16px;
  color: #285d3d;
  background: #eef7f1;
  border: 1px solid #bdd9c6;
  font-size: 13px;
  line-height: 1.5;
}

body[data-initial-view="profile"] .profile-payment-status.is-error {
  color: var(--sek-burgundy);
  background: #fbefee;
  border-color: #e3c1be;
}

body[data-initial-view="profile"] .profile-billing-section {
  grid-column: 1 / -1;
  margin-top: 24px;
  padding: 24px 26px 22px;
  background: #fffefa;
  border: 1px solid var(--sek-line);
  border-left: 4px solid var(--sek-burgundy);
}

body[data-initial-view="profile"] .profile-billing-section.is-unlimited {
  border-left-color: var(--sek-success);
}

body[data-initial-view="profile"] .profile-credit-section {
  grid-column: 1 / -1;
}

body[data-initial-view="profile"] .profile-credit-layout {
  grid-template-columns: minmax(240px, 4fr) minmax(320px, 8fr);
  gap: 28px;
}

body[data-initial-view="profile"] .profile-credit-ledger {
  padding-left: 28px;
  border-left: 1px solid var(--sek-line);
}

body[data-initial-view="profile"] .profile-credit-head h3 {
  margin-bottom: 0;
}

body[data-initial-view="profile"] .profile-credit-history-head {
  color: var(--sek-muted);
}

body[data-initial-view="profile"] .profile-credit-entry {
  border-color: var(--sek-line);
}

body[data-initial-view="profile"] .profile-credit-entry-details,
body[data-initial-view="profile"] .profile-credit-empty {
  color: var(--sek-muted);
}

body[data-initial-view="profile"] .profile-billing-head {
  margin-bottom: 22px;
}

body[data-initial-view="profile"] .profile-billing-caption {
  color: var(--sek-muted);
}

body[data-initial-view="profile"] .profile-billing-badge {
  color: var(--sek-burgundy);
  background: rgba(110, 30, 36, 0.06);
  border-color: rgba(110, 30, 36, 0.2);
  border-radius: 2px;
}

body[data-initial-view="profile"] .profile-billing-balance span,
body[data-initial-view="profile"] .profile-billing-progress > span,
body[data-initial-view="profile"] .profile-billing-metric span,
body[data-initial-view="profile"] .profile-billing-note {
  color: var(--sek-muted);
}

body[data-initial-view="profile"] .profile-billing-balance strong {
  color: var(--sek-ink);
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-weight: 700;
}

body[data-initial-view="profile"] .profile-billing-track {
  background: #e3ded3;
}

body[data-initial-view="profile"] .profile-billing-bar {
  background: var(--sek-burgundy);
}

body[data-initial-view="profile"] .profile-billing-section.is-unlimited .profile-billing-bar {
  background: var(--sek-success);
}

body[data-initial-view="profile"] .profile-billing-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--sek-line);
  border-color: var(--sek-line);
  border-radius: 2px;
}

body[data-initial-view="profile"] .profile-billing-metric {
  background: #f8f5ed;
}

body[data-initial-view="profile"] .profile-billing-metric strong {
  color: var(--sek-ink);
}

body[data-initial-view="profile"] .profile-account-section {
  grid-column: 1 / 5;
}

body[data-initial-view="profile"] .profile-stats-section {
  grid-column: 5 / -1;
}

body[data-initial-view="profile"] .profile-settings-section,
body[data-initial-view="profile"] .profile-admin-section {
  grid-column: 1 / -1;
  padding-left: 0;
  border-left: 0;
}

body[data-initial-view="profile"] .profile-template-section,
body[data-initial-view="profile"] .profile-notifications-section,
body[data-initial-view="profile"] .profile-password-section,
body[data-initial-view="profile"] .profile-sessions-section {
  grid-column: auto;
  padding-left: 0;
  border-left: 0;
}

body[data-initial-view="profile"] .profile-security-grid .logout-btn {
  grid-column: 1 / -1;
  min-height: 40px;
  margin: 22px 0 0;
}

.field > small {
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.4;
}

body[data-initial-view="profile"] .profile-login-row {
  color: var(--sek-muted);
  border-color: var(--sek-line);
}

body[data-initial-view="profile"] .profile-login-row strong {
  color: var(--sek-ink);
}

@media (max-width: 850px) {
  body[data-initial-view="profile"] .profile-credit-layout {
    grid-template-columns: 1fr;
  }

  body[data-initial-view="profile"] .profile-credit-ledger {
    padding-top: 20px;
    padding-left: 0;
    border-top: 1px solid var(--sek-line);
    border-left: 0;
  }

  body[data-initial-view="profile"] .profile-billing-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-initial-view="profile"] .profile-account-section,
  body[data-initial-view="profile"] .profile-stats-section,
  body[data-initial-view="profile"] .profile-settings-section,
  body[data-initial-view="profile"] .profile-admin-section {
    grid-column: 1 / -1;
  }

  .profile-security-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body[data-initial-view="profile"] .profile-billing-section {
    padding: 20px 16px 18px;
  }

  body[data-initial-view="profile"] .profile-tabs {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  body[data-initial-view="profile"] .profile-tab {
    padding-right: 13px;
    padding-left: 13px;
  }
}

@media (max-width: 520px) {
  body[data-initial-view="profile"] .profile-billing-head {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-initial-view="profile"] .profile-billing-metrics {
    grid-template-columns: 1fr;
  }
}
