:root {
  color-scheme: light;
  font-family: "Heebo", "Segoe UI", "Arial Hebrew", system-ui, sans-serif;
  color: #1B2430;
  background: #F4F3EF;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 0;
  min-height: 100%;
  background: #F4F3EF;
}

body {
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  color: #FFFFFF;
  background: #1F4E79;
  font-weight: 700;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 78, 121, 0.35);
  outline-offset: 2px;
}

a {
  color: #1F4E79;
}

button:disabled {
  cursor: not-allowed;
}

.test-strip {
  width: 100%;
  padding: 8px 16px;
  text-align: center;
  color: #6E4700;
  background: #FCF0D9;
  border-bottom: 1px solid #E0C98C;
  font-size: 14px;
  font-weight: 700;
}

.auth-shell {
  min-height: calc(100vh - 37px);
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.card {
  background: #FFFFFF;
  border: 1px solid #E2DFD8;
  border-radius: 14px;
}

.login-card {
  width: min(100%, 430px);
  padding: 28px;
  box-shadow: 0 14px 40px rgba(27, 36, 48, 0.08);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 10px;
  color: #FFFFFF;
  background: #1F4E79;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 27px;
}

.muted {
  color: #5B6472;
}

form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

label {
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #C9C5BC;
  border-radius: 8px;
  padding: 10px 12px;
  color: #1B2430;
  background: #FFFFFF;
}

textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid #C9C5BC;
  border-radius: 8px;
  padding: 11px 12px;
  color: #1B2430;
  background: #FFFFFF;
  line-height: 1.6;
}

form button {
  margin-top: 8px;
}

.error-line {
  min-height: 24px;
  margin: 14px 0 0;
  color: #9B2C2C;
  font-size: 14px;
}

.success-line {
  min-height: 24px;
  margin: 14px 0 0;
  color: #24613E;
  font-size: 14px;
  font-weight: 700;
}

.setup-rule {
  line-height: 1.6;
}

.setup-message {
  margin-bottom: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  color: #FFFFFF;
  background: #1B2430;
}

.app-header h1 {
  margin-bottom: 0;
  font-size: 22px;
}

.eyebrow {
  margin-bottom: 2px;
  color: #AFC4D8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.account-area {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#signed-email {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  white-space: nowrap;
  font-size: 14px;
}

.outline-button {
  color: #FFFFFF;
  background: transparent;
  border: 1px solid #4A5668;
}

.main-content {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 32px 24px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-heading h2 {
  margin-bottom: 6px;
  font-size: 28px;
}

.empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 32px;
  text-align: center;
}

.empty-state h3 {
  margin: 14px 0 8px;
  font-size: 20px;
}

.empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #1F4E79;
  background: #E8EFF6;
  font-size: 22px;
  font-weight: 900;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 18px;
}

.case-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  box-shadow: 0 6px 24px rgba(27, 36, 48, 0.05);
}

.case-card-top,
.case-hero-top,
.chapter-heading,
.tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.case-identity,
.case-hero-top > div,
.chapter-heading > div,
.tool-heading > div {
  min-width: 0;
}

.case-number-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.case-number {
  direction: ltr;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.work-type {
  margin: 7px 0 0;
  color: #1F4E79;
  font-size: 14px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.sample-badge {
  color: #6E4700;
  background: #FCF0D9;
  border: 1px solid #E0C98C;
}

.stage-badge,
.tool-stage {
  flex: 0 0 auto;
  color: #163A5B;
  background: #E8EFF6;
}

.stage-done,
.status-approved,
.counter-approved {
  color: #24613E;
  background: #E8F4EC;
}

.stage-in_work,
.status-draft,
.counter-draft {
  color: #6E4700;
  background: #FCF0D9;
}

.stage-phase_2 {
  color: #693C74;
  background: #F1EAF3;
}

.case-title {
  min-height: 54px;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 19px;
  line-height: 1.4;
}

.progress-block {
  min-width: 0;
}

.progress-label {
  margin-bottom: 7px;
  color: #485363;
  font-size: 13px;
  font-weight: 700;
}

.case-progress {
  width: 100%;
  height: 10px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: #1F4E79;
  background: #E2E6EA;
}

.case-progress::-webkit-progress-bar {
  background: #E2E6EA;
}

.case-progress::-webkit-progress-value {
  background: #1F4E79;
  border-radius: 999px;
}

.case-progress::-moz-progress-bar {
  background: #1F4E79;
  border-radius: 999px;
}

.case-news {
  min-height: 22px;
  margin: 0;
  color: #5B6472;
  font-size: 14px;
}

.case-quality-note {
  margin: -8px 0 0;
  color: #8A3A2B;
  font-size: 13px;
  font-weight: 800;
}

.open-case {
  margin-top: auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-weight: 800;
  text-decoration: none;
}

.back-link::before {
  content: "← ";
}

.case-hero {
  min-width: 0;
  padding: 24px;
  color: #FFFFFF;
  background: #1B2430;
  border-radius: 16px;
}

.case-hero h2 {
  max-width: 780px;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
  font-size: 25px;
  line-height: 1.4;
}

.case-hero .work-type {
  color: #AFC4D8;
}

.valuation-control {
  display: grid;
  grid-template-columns: minmax(150px, 220px) auto;
  align-items: end;
  gap: 8px;
  margin-top: 16px;
}

.valuation-control label {
  display: grid;
  gap: 5px;
  color: #DDE5ED;
}

.valuation-date-input {
  direction: ltr;
  min-height: 42px;
}

.valuation-save {
  min-height: 42px;
  color: #FFFFFF;
  background: transparent;
  border-color: #8FB4D9;
}

.valuation-control .write-error {
  grid-column: 1 / -1;
  color: #FFD2CC;
}

.case-hero .progress-block {
  margin-top: 22px;
}

.case-hero .progress-label {
  color: #DDE5ED;
}

.case-hero .case-progress {
  background: #4A5668;
}

.case-hero .case-progress::-webkit-progress-bar {
  background: #4A5668;
}

.case-hero .case-progress::-webkit-progress-value,
.case-hero .case-progress::-moz-progress-bar {
  background: #8FB4D9;
}

.counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.counter {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-radius: 10px;
  padding: 11px 13px;
}

.counter strong {
  font-size: 20px;
}

.counter span {
  font-size: 13px;
  font-weight: 700;
}

.counter-not-started {
  color: #DDE5ED;
  background: #333E4D;
}

.spec-summary {
  margin: 18px 0;
  color: #3F4B5A;
  font-size: 14px;
  font-weight: 800;
}

.entity-summary {
  margin-bottom: 18px;
  padding: 17px 20px;
}

.entity-summary h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.entity-counts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.entity-count {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px;
  text-align: center;
  background: #F4F3EF;
  border-radius: 8px;
}

.entity-count span {
  color: #5B6472;
  font-size: 12px;
}

.case-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  border-bottom: 1px solid #D6D2CA;
}

.case-tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 15px;
  color: #485363;
  border-bottom: 3px solid transparent;
  font-weight: 800;
  text-decoration: none;
}

.case-tab.selected {
  color: #1F4E79;
  border-bottom-color: #1F4E79;
}

.chapter-document-count {
  margin: 0 0 14px;
  color: #1F4E79;
  font-size: 14px;
  font-weight: 800;
}

.documents-panel,
.documents-section,
.documents-list,
.missing-list {
  min-width: 0;
}

.folder-status {
  margin-bottom: 14px;
  color: #3F4B5A;
  font-weight: 800;
}

.document-counters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.counter-files,
.counter-read,
.counter-unread,
.counter-missing {
  color: #303B49;
  background: #FFFFFF;
  border: 1px solid #E2DFD8;
}

.documents-section {
  margin-top: 24px;
}

.documents-section > h3 {
  margin-bottom: 12px;
  font-size: 19px;
}

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

.document-card,
.missing-item {
  min-width: 0;
  padding: 16px;
}

.document-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.document-heading > div {
  min-width: 0;
}

.document-name,
.missing-item h4 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.document-kind {
  margin: 5px 0 0;
  color: #5B6472;
  font-size: 13px;
}

.read-state {
  flex: 0 0 auto;
}

.read-yes {
  color: #24613E;
  background: #E8F4EC;
}

.read-no {
  color: #8A3A2B;
  background: #F8E8E4;
}

.read-unknown {
  color: #5B6472;
  background: #ECEDEF;
}

.document-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
  color: #485363;
  font-size: 13px;
}

.changed-badge {
  color: #6E4700;
  background: #FCF0D9;
}

.document-feeds {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #ECE9E3;
}

.document-feeds-label {
  display: block;
  margin-bottom: 7px;
  color: #5B6472;
  font-size: 12px;
  font-weight: 800;
}

.chapter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chapter-chip {
  min-height: 34px;
  padding: 6px 10px;
  color: #1F4E79;
  background: #E8EFF6;
  font-size: 12px;
}

.missing-verdict {
  margin: 12px 0 0;
  color: #8A3A2B;
  font-size: 14px;
  font-weight: 800;
}

.case-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.chapter-rail {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.chapter-link {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 9px 10px;
  color: #303B49;
  background: #FFFFFF;
  border: 1px solid #E2DFD8;
  text-align: right;
  font-size: 13px;
}

.rail-marks {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  align-items: center;
  gap: 3px;
}

.chapter-link.selected {
  color: #163A5B;
  background: #E8EFF6;
  border-color: #8FB4D9;
}

.status-dot {
  width: 9px;
  height: 9px;
  display: block;
  border-radius: 50%;
  background: #AEB5BE;
}

.status-dot.status-approved {
  background: #3D8A5E;
}

.status-dot.status-draft {
  background: #C88B25;
}

.night-draft-dot {
  width: 7px;
  height: 7px;
  display: block;
  border-radius: 50%;
  background: #4E77A0;
  box-shadow: 0 0 0 2px #DCE8F3;
}

.chapter-index {
  direction: ltr;
  color: #697382;
  font-weight: 800;
}

.chapter-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.chapter-heading {
  margin-bottom: 14px;
}

.chapter-heading h3 {
  margin: 2px 0 0;
  font-size: 24px;
}

.chapter-overline {
  margin-bottom: 0;
  color: #1F4E79;
  font-size: 13px;
  font-weight: 900;
}

.status-not_started,
.tool-stage.stage-first_version {
  color: #3E4A59;
  background: #E8EAED;
}

.chapter-notes {
  margin-bottom: 14px;
  padding: 14px 17px;
  color: #5D4A19;
  background: #FCF6E8;
  border: 1px solid #EAD8A7;
  border-radius: 10px;
}

.chapter-notes h4 {
  margin: 0 0 7px;
}

.chapter-notes ul {
  margin: 0;
  padding-right: 20px;
}

.tools-disclaimer {
  margin: 0 0 14px;
  color: #485363;
  font-size: 14px;
  font-weight: 800;
}

.night-draft-panel {
  margin: 0 0 18px;
  padding: 18px;
  border-color: #B8CDE0;
  box-shadow: 0 5px 20px rgba(31, 78, 121, 0.05);
}

.night-draft-panel > h4 {
  margin: 0 0 5px;
  color: #163A5B;
  font-size: 19px;
}

.night-draft-label {
  margin: 0 0 15px;
  color: #5B6472;
  font-size: 13px;
  font-weight: 800;
}

.night-draft-item {
  padding: 15px 0 0;
  border-top: 1px solid #E1E8EF;
}

.night-draft-item + .night-draft-item {
  margin-top: 16px;
}

.night-draft-item > h5 {
  margin: 0 0 8px;
  font-size: 16px;
}

.shared-draft-note {
  margin: 0 0 11px;
  color: #1F4E79;
  font-size: 13px;
  font-weight: 800;
}

.missing-night-draft,
.no-night-draft {
  margin: 0;
  color: #8A3A2B;
  font-weight: 800;
}

.night-draft-text {
  color: #303B49;
  line-height: 1.72;
}

.draft-heading {
  margin: 15px 0 7px;
}

.draft-paragraph {
  margin: 0 0 9px;
  white-space: pre-wrap;
}

.draft-list {
  margin: 0 0 10px;
  padding-right: 22px;
}

.source-marker {
  min-height: 25px;
  margin: 0 4px;
  padding: 2px 8px;
  vertical-align: baseline;
  color: #1F4E79;
  background: #E8EFF6;
  border: 1px solid #AFC4D8;
  border-radius: 999px;
  font-size: 11px;
}

.source-marker.unsourced-marker {
  color: #8A3A2B;
  background: #F8E8E4;
  border-color: #D8A89F;
  opacity: 1;
}

.draft-sources {
  margin-top: 15px;
}

.draft-sources > h5 {
  margin: 0 0 8px;
  color: #485363;
  font-size: 14px;
}

.source-rows {
  display: grid;
  gap: 8px;
}

.source-row {
  padding: 12px;
  background: #F7F9FB;
  border: 1px solid #DCE4EB;
  border-radius: 9px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.source-row.source-highlight {
  border-color: #C88B25;
  box-shadow: 0 0 0 3px rgba(200, 139, 37, 0.2);
}

.source-row-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.source-number {
  color: #1F4E79;
  font-size: 12px;
  font-weight: 900;
}

.source-facts,
.source-passage {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: #5B6472;
  font-size: 12px;
}

.source-passage {
  color: #303B49;
}

.public-source-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
}

.unsourced-note,
.unsourced-summary.warning {
  color: #8A3A2B;
  font-weight: 800;
}

.take-night-draft {
  margin-top: 13px;
}

.chapter-work {
  min-width: 0;
  margin: 0 0 20px;
}

.chapter-work > h4 {
  margin: 0 0 11px;
  font-size: 20px;
}

.work-items {
  display: grid;
  gap: 12px;
}

.work-item,
.new-draft-box {
  min-width: 0;
  padding: 17px;
}

.work-item-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 11px;
}

.work-origin {
  color: #5B6472;
  font-size: 13px;
  font-weight: 800;
}

.draft-state-line {
  margin: 14px 0 0;
  color: #303B49;
  font-size: 13px;
  font-weight: 800;
}

.unsourced-figure-line {
  margin: 9px 0 0;
  padding: 9px 11px;
  color: #8A3A2B;
  background: #F8E8E4;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.work-actions,
.chapter-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.approve-button {
  color: #FFFFFF;
  background: #24613E;
}

.approve-button:disabled {
  color: #6A727D;
  background: #ECEDEF;
}

.draft-editor {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.draft-editor label {
  display: grid;
  gap: 6px;
}

.new-draft-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.new-draft-box h5,
.chapter-history h5 {
  margin: 0;
  font-size: 16px;
}

.new-draft-box .approve-button {
  width: max-content;
}

.write-error {
  min-height: 20px;
  margin: 7px 0 0;
  color: #9B2C2C;
  font-size: 13px;
  font-weight: 700;
}

.chapter-history {
  margin-top: 18px;
  padding: 15px 17px;
  background: #FFFFFF;
  border: 1px solid #E2DFD8;
  border-radius: 10px;
}

.chapter-history ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-right: 20px;
  color: #485363;
  font-size: 13px;
}

.checks-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.quality-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}

.counter-passed {
  color: #24613E;
  background: #E8F4EC;
  border: 1px solid #BEDAC7;
}

.counter-failed {
  color: #8A3A2B;
  background: #F8E8E4;
  border: 1px solid #E2BEB5;
}

.counter-attention {
  color: #6E4700;
  background: #FCF0D9;
  border: 1px solid #E0C98C;
}

.counter-not-checked {
  color: #4E5866;
  background: #ECEDEF;
  border: 1px dashed #9DA4AE;
}

.unsourced-summary {
  margin: 0 0 20px;
  padding: 11px 13px;
  background: #FFFFFF;
  border: 1px solid #E2DFD8;
  border-radius: 9px;
  font-weight: 800;
}

.checks-list {
  display: grid;
  gap: 9px;
}

.quality-group {
  margin-top: 24px;
}

.checks-list > h3 {
  margin-bottom: 3px;
}

.check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
}

.quality-check-description {
  min-width: 0;
}

.quality-check-title {
  overflow-wrap: anywhere;
}

.technical-check-name {
  display: block;
}

.quality-waiting {
  margin: 5px 0 0;
  color: #5B6472;
  font-size: 13px;
}

.quality-check-items {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding-right: 20px;
  color: #485363;
  font-size: 13px;
}

.quality-chapter-link,
.next-step-link {
  color: #1F4E79;
  font-weight: 800;
}

.check-name {
  direction: ltr;
  overflow-wrap: anywhere;
  text-align: right;
}

.check-passed {
  color: #24613E;
  background: #E8F4EC;
}

.check-failed {
  color: #8A3A2B;
  background: #F8E8E4;
}

.check-attention {
  color: #6E4700;
  background: #FCF0D9;
}

.check-not_checked {
  color: #5B6472;
  background: #ECEDEF;
}

.check-count {
  color: #5B6472;
  font-size: 12px;
}

.next-steps {
  margin-top: 28px;
  padding: 18px 20px;
  background: #FFFFFF;
  border: 1px solid #D8DDE3;
  border-radius: 12px;
}

.next-steps h3 {
  margin: 0 0 12px;
}

.next-steps-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-right: 22px;
}

.tools-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 17px;
}

.tool-card h4 {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.tool-key {
  direction: ltr;
  color: #1F4E79;
  font-size: 12px;
  font-weight: 900;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 13px 0;
}

.kind-source {
  color: #245B51;
  background: #E3F1EE;
}

.kind-processing {
  color: #5D4771;
  background: #EFE9F4;
}

.tool-description {
  flex: 1;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
  color: #485363;
  font-size: 14px;
  line-height: 1.55;
}

.stage-note {
  margin: 0 0 14px;
  padding-top: 10px;
  color: #5B6472;
  border-top: 1px solid #ECE9E3;
  font-size: 13px;
}

.disabled-tool {
  width: 100%;
  color: #6A727D;
  background: #ECEDEF;
}

.chapter-navigation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.secondary-button {
  color: #1F4E79;
  background: #FFFFFF;
  border: 1px solid #AFC4D8;
}

.secondary-button:disabled {
  color: #949AA2;
  background: #ECEDEF;
  border-color: #D7D9DC;
}

.loading-line {
  padding: 40px 0;
  color: #5B6472;
  text-align: center;
}

@media (max-width: 600px) {
  .login-card {
    padding: 22px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .account-area {
    width: 100%;
    justify-content: space-between;
  }

  #signed-email {
    max-width: calc(100vw - 120px);
  }

  .main-content {
    padding: 24px 16px;
  }

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

  .empty-state {
    min-height: 230px;
    padding: 24px 16px;
  }

  .case-card-top,
  .case-hero-top,
  .chapter-heading {
    gap: 10px;
  }

  .case-hero {
    padding: 18px 16px;
  }

  .case-hero h2 {
    font-size: 21px;
  }

  .valuation-control {
    grid-template-columns: 1fr;
  }

  .valuation-save {
    width: 100%;
  }

  .valuation-control .write-error {
    grid-column: auto;
  }

  .counters {
    gap: 6px;
  }

  .counter {
    display: grid;
    gap: 2px;
    padding: 9px 7px;
  }

  .entity-counts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-tabs {
    width: 100%;
  }

  .case-tab {
    flex: 1;
    justify-content: center;
    padding-right: 8px;
    padding-left: 8px;
    text-align: center;
  }

  .document-counters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .checks-counters {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .quality-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .check-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .check-count {
    grid-column: 1 / -1;
  }

  .documents-list,
  .missing-list {
    grid-template-columns: 1fr;
  }

  .case-layout {
    display: block;
  }

  .chapter-rail {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 7px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .chapter-link {
    flex: 0 0 225px;
    scroll-snap-align: start;
  }

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

  .work-actions,
  .chapter-approval-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .work-actions button,
  .chapter-approval-actions button,
  .new-draft-box .approve-button {
    width: 100%;
  }

  .chapter-navigation button {
    flex: 1;
    padding-right: 8px;
    padding-left: 8px;
  }
}
