.case-page [hidden] {
  display: none !important;
}

.case-workspace .case-panel + .case-panel {
  margin-top: 0;
}

.case-next-action {
  align-items: start;
  background: #e7f4d8;
  border: 1px solid #c7dda9;
  border-radius: 5px 15px 5px 5px;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(160px, .32fr);
  margin-top: 30px;
  padding: clamp(20px, 4vw, 30px);
}

.case-next-action .kicker {
  margin-bottom: 8px;
}

.case-next-action h3 {
  font-size: clamp(23px, 3vw, 34px);
  letter-spacing: -.045em;
  line-height: 1.08;
  margin: 0;
}

.case-next-action p:last-child {
  color: #526159;
  font-size: 13px;
  line-height: 1.65;
  margin: 13px 0 0;
}

.case-next-action dl,
.case-next-action dd {
  margin: 0;
}

.case-next-action dl {
  border-left: 1px solid #bfd19f;
  padding-left: 24px;
}

.case-next-action dt,
.clock-grid dt,
.delivery-details dt {
  color: var(--muted);
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.case-next-action dd {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
  margin-top: 8px;
}

.case-record-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 28px;
}

.case-record-tools .text-button {
  margin-top: 0;
}

.case-record-tools .text-button:disabled {
  cursor: wait;
  opacity: .5;
}

.case-record-tools .text-button:focus-visible {
  outline: 3px solid var(--acid-deep);
  outline-offset: 3px;
}

.case-sync-status,
.case-tool-status,
.case-private-warning {
  font-size: 11px;
  line-height: 1.55;
}

.case-sync-status {
  margin: 18px 0 0;
}

.case-tool-status {
  background: #e7f4d8;
  border-left: 3px solid var(--acid-deep);
  color: #334138 !important;
  margin: 13px 0 0;
  padding: 9px 11px;
}

.case-tool-status[data-tone="error"] {
  background: #f8e7e2;
  border-left-color: var(--danger);
  color: #7c2e1e !important;
}

.case-tool-status:empty {
  display: none;
}

.case-private-warning {
  border-top: 1px solid var(--line);
  margin: 18px 0 0;
  padding-top: 16px;
}

.progress-panel h2 {
  margin-bottom: 32px;
}

.case-progress {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.case-progress li {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 4px 11px 4px 4px;
  display: flex;
  flex-direction: column;
  min-height: 142px;
  padding: 16px 14px;
  position: relative;
}

.case-progress li::after {
  background: var(--line);
  content: "";
  height: 1px;
  left: 100%;
  position: absolute;
  top: 30px;
  width: 11px;
}

.case-progress li:last-child::after {
  display: none;
}

.case-progress li[data-state="complete"] {
  background: #e7f4d8;
  border-color: #c7dda9;
}

.case-progress li[data-state="current"] {
  background: var(--acid);
  border-color: #9ecb51;
  box-shadow: 0 10px 25px rgba(83, 112, 42, .16);
  transform: translateY(-3px);
}

.case-progress li[data-state="closed"] {
  background:
    repeating-linear-gradient(
      -45deg,
      #f2eee9,
      #f2eee9 8px,
      #e9e3dc 8px,
      #e9e3dc 9px
    );
  color: #756c64;
}

.case-step-number {
  color: #6c7a72;
  font: 750 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}

.case-progress strong {
  font-size: 14px;
  line-height: 1.25;
  margin-top: 21px;
}

.case-progress small {
  color: #68766f;
  font-size: 10px;
  line-height: 1.45;
  margin-top: 8px;
}

.panel-heading-row {
  align-items: start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.panel-heading-row h2 {
  margin-bottom: 0;
}

.clock-state-badge,
.delivery-state-badge {
  background: var(--paper-deep);
  border-radius: 999px;
  flex: 0 0 auto;
  font: 750 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .07em;
  padding: 10px 13px;
  text-transform: uppercase;
}

.clock-state-badge[data-state="running"],
.clock-state-badge[data-state="completed"],
.delivery-state-badge[data-state="delivered"] {
  background: var(--acid);
}

.clock-state-badge[data-state="paused"] {
  background: #fff0b8;
  color: #69520d;
}

.clock-state-badge[data-state="refunded"],
.delivery-state-badge[data-state="refunded"],
.delivery-state-badge[data-state="declined"] {
  background: #f1d8d1;
  color: #7c2e1e;
}

.clock-summary {
  border-left: 3px solid var(--acid-deep);
  margin: 30px 0 0;
  padding: 3px 0 3px 18px;
}

.clock-grid {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 32px 0 0;
  padding-top: 23px;
}

.clock-grid > div,
.delivery-details > div {
  min-width: 0;
}

.clock-grid dd,
.delivery-details dd {
  line-height: 1.5;
  margin: 7px 0 0;
  overflow-wrap: anywhere;
}

.clock-grid dd {
  font-size: 14px;
  font-weight: 680;
}

.clock-grid small {
  color: var(--muted);
  display: block;
  font-size: 10px;
  line-height: 1.45;
  margin-top: 6px;
}

.clock-reason {
  background: var(--paper-deep);
  border-radius: 4px;
  grid-column: 1 / -1;
  padding: 16px;
}

.clock-boundary,
.delivery-source-note {
  border-top: 1px solid var(--line);
  font-size: 11px;
  margin: 26px 0 0;
  padding-top: 17px;
}

.payment-panel .payment-no-browser-action {
  background: rgba(255, 255, 255, .52);
  border-left: 3px solid #729b35;
  font-size: 13px;
  margin: 18px 0 0;
  padding: 12px 14px;
}

.refund-receipt-panel {
  background: #edf7df;
}

.refund-receipt-grid {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 28px 0 0;
  padding-top: 22px;
}

.refund-receipt-grid dd {
  font-size: 13px;
  line-height: 1.5;
  margin: 7px 0 0;
  overflow-wrap: anywhere;
}

.refund-receipt-wide {
  grid-column: 1 / -1;
}

.refund-receipt-timing {
  border-top: 1px solid var(--line);
  font-size: 12px;
  margin: 22px 0 0;
  padding-top: 16px;
}

.delivery-panel[data-delivery-state="delivered"] {
  background: #edf7df;
}

.delivery-panel[data-delivery-state="refund-required"] {
  background: #fff0d9;
}

.delivery-empty {
  margin: 30px 0 0;
}

.delivery-details {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 30px 0 0;
  padding-top: 23px;
}

.delivery-wide {
  grid-column: 1 / -1;
}

.delivery-details dd {
  font-size: 14px;
  white-space: pre-wrap;
}

.message-list .case-empty-message {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.scope-acceptance-action {
  align-self: flex-start;
  background: var(--acid);
  border: 1px solid #9ecb51;
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  font: 750 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .02em;
  margin-top: 16px;
  padding: 11px 13px;
}

.scope-acceptance-action:hover {
  background: #c6ee83;
}

.scope-acceptance-action:focus-visible {
  outline: 3px solid var(--acid-deep);
  outline-offset: 3px;
}

.message-form > p.scope-acceptance-status {
  background: #e7f4d8;
  border-left: 3px solid var(--acid-deep);
  color: #334138;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  padding: 10px 12px;
}

.message-form > p.scope-acceptance-status:empty {
  display: none;
}

@media (max-width: 940px) {
  .case-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-progress li:nth-child(3)::after {
    display: none;
  }

  .clock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .case-next-action {
    grid-template-columns: 1fr;
  }

  .case-next-action dl {
    border-left: 0;
    border-top: 1px solid #bfd19f;
    padding: 18px 0 0;
  }

  .case-record-tools {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .case-progress li {
    min-height: 0;
    padding-left: 54px;
  }

  .case-progress li::after,
  .case-progress li:nth-child(3)::after {
    display: block;
    height: 11px;
    left: 27px;
    top: 100%;
    width: 1px;
  }

  .case-progress li:last-child::after {
    display: none;
  }

  .case-step-number {
    left: 16px;
    position: absolute;
    top: 17px;
  }

  .case-progress strong {
    margin-top: 0;
  }

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

  .clock-grid,
  .delivery-details,
  .refund-receipt-grid {
    grid-template-columns: 1fr;
  }

  .delivery-wide,
  .refund-receipt-wide {
    grid-column: auto;
  }
}
