/* EDS Workspace: page-scoped extension of the existing dark forensic system. */
html,
body {
  min-width: 0;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
}

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

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

.ws-hidden {
  display: none !important;
}

.ws-status {
  position: fixed;
  z-index: 70;
  top: 12px;
  right: 12px;
  max-width: calc(100vw - 24px);
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.3;
}

.ws-status[data-state='error'] {
  border-color: #f87171;
  color: #fecaca;
}

.ws-entry {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 72px 16px 40px;
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.13), transparent 34rem),
    var(--bg-main);
}

.ws-entry-card {
  width: min(100%, 680px);
  padding: clamp(24px, 6vw, 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-elevated);
}

.ws-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.ws-brand img {
  display: block;
  border-radius: 10px;
}

.ws-eyebrow,
.ws-label,
.ws-step,
.ws-stage {
  margin: 0 0 8px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.ws-entry-card .ws-eyebrow {
  margin-top: 48px;
}

.ws-entry-card h1,
.ws-case-header h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 800;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.ws-entry-card h2,
.ws-view h2,
.ws-dialog h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ws-view h3,
.ws-dialog h3 {
  color: var(--text-primary);
}

.ws-lead {
  margin: 18px 0 28px;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.7;
}

.ws-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.ws-actions-stack {
  align-items: stretch;
  flex-direction: column;
}

.ws-action-spacer {
  flex: 1 1 auto;
}

.ws-button {
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.ws-button:focus-visible,
.ws-text-button:focus-visible,
.ws-icon-button:focus-visible,
.ws-nav button:focus-visible,
.ws-mobile-nav button:focus-visible,
.ws-filter-row button:focus-visible,
.ws-metrics button:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.55);
  outline-offset: 3px;
}

.ws-button-primary {
  border-color: var(--primary-hover);
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-cta);
}

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

.ws-button-secondary {
  border-color: var(--border);
  background: var(--surface-elevated);
  color: #e2e8f0;
}

.ws-button-secondary:hover {
  border-color: #64748b;
  background: #17233a;
}

.ws-button-danger {
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
}

.ws-button-danger:hover {
  background: rgba(153, 27, 27, 0.46);
}

.ws-button:disabled,
.ws-text-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ws-text-button,
.ws-icon-button {
  min-height: 44px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: #93c5fd;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.ws-icon-button {
  min-width: 44px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 18px;
}

.ws-note,
.ws-alert,
.ws-warning {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: #cbd5e1;
}

.ws-note p,
.ws-alert p,
.ws-warning p {
  margin: 6px 0 0;
}

.ws-warning {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(120, 53, 15, 0.14);
}

.ws-alert-error {
  border-color: rgba(248, 113, 113, 0.56);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
}

.ws-privacy-line,
.ws-fine-print {
  margin: 24px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
}

.ws-rule-list {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.ws-rule-list article {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
}

.ws-rule-list strong {
  color: var(--text-primary);
}

.ws-rule-list p {
  margin: 5px 0 0;
}

.ws-check-row {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  color: #cbd5e1;
  line-height: 1.5;
}

.ws-check-row input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: var(--primary-hover);
}

.ws-field,
.ws-choice-group {
  min-width: 0;
  display: block;
  margin-top: 20px;
}

.ws-field > span,
.ws-choice-group legend {
  display: block;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 750;
}

.ws-field input,
.ws-field select,
.ws-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  outline: none;
  background: #0b1220;
  color: #f8fafc;
}

.ws-field textarea {
  min-height: 94px;
  resize: vertical;
}

.ws-field input:focus,
.ws-field select:focus,
.ws-field textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.ws-field small {
  display: block;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.ws-field b,
.ws-choice-group b,
.ws-field-error {
  display: block;
  min-height: 0;
  margin: 6px 0 0;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

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

.ws-choice-group {
  padding: 0;
  border: 0;
}

.ws-choice-group label {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b1220;
  color: #cbd5e1;
  cursor: pointer;
}

.ws-choice-group input,
.ws-radio-list input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-hover);
}

.ws-choice-stack label {
  display: flex;
  margin-right: 0;
}

.ws-details {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.74);
}

.ws-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 750;
}

.ws-details summary span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.ws-shell {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.ws-rail {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  border-right: 1px solid var(--border);
  background: #080d17;
}

.ws-rail-brand {
  padding: 0 10px 28px;
}

.ws-nav {
  display: grid;
  gap: 6px;
}

.ws-nav button,
.ws-mobile-nav button {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.ws-nav button[aria-current='page'],
.ws-mobile-nav button[aria-current='page'] {
  border-color: #334155;
  background: var(--surface);
  color: #f8fafc;
}

.ws-nav button span {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #17233a;
  color: #cbd5e1;
  font-size: 11px;
  text-align: center;
}

.ws-rail-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 18px 10px 0;
}

.ws-local-mark {
  color: #86efac;
  font-size: 12px;
}

.ws-main {
  width: min(100%, 1000px);
  min-width: 0;
  margin-inline: auto;
  padding: 34px clamp(18px, 5vw, 52px) 80px;
}

.ws-case-header,
.ws-view-heading,
.ws-panel-heading,
.ws-charge-card,
.ws-dialog-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ws-case-header {
  margin-bottom: 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.ws-case-header h1 {
  font-size: clamp(25px, 5vw, 36px);
}

.ws-view {
  min-width: 0;
}

.ws-view-heading {
  margin-bottom: 22px;
}

.ws-view-heading p,
.ws-panel p,
.ws-charge-card p,
.ws-list p,
.ws-timeline p {
  color: #94a3b8;
  line-height: 1.65;
}

.ws-charge-card,
.ws-panel,
.ws-summary-card {
  min-width: 0;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.ws-charge-card h2 {
  font-size: clamp(24px, 5vw, 34px);
}

.ws-charge-card p:last-child,
.ws-panel p:last-child {
  margin-bottom: 0;
}

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

.ws-metrics span,
.ws-metrics button {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b1220;
  color: #94a3b8;
  cursor: default;
  text-align: left;
}

.ws-metrics button {
  cursor: pointer;
}

.ws-metrics strong {
  color: #f8fafc;
  font-size: 22px;
}

.ws-filter-row {
  min-width: 0;
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ws-filter-row button {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.ws-filter-row button[aria-pressed='true'] {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
}

.ws-list,
.ws-timeline {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.ws-list-item,
.ws-timeline-item,
.ws-empty {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.ws-list-item,
.ws-timeline-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ws-list-item h3,
.ws-timeline-item h3,
.ws-empty h3 {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
}

.ws-list-item p,
.ws-timeline-item p,
.ws-empty p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.ws-item-meta {
  color: #93c5fd !important;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.ws-item-action {
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b1220;
  color: #cbd5e1;
  cursor: pointer;
}

.ws-timeline {
  position: relative;
  padding-left: 18px;
}

.ws-timeline::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 3px;
  width: 1px;
  background: #334155;
  content: '';
}

.ws-timeline-item {
  position: relative;
}

.ws-timeline-item::before {
  position: absolute;
  top: 23px;
  left: -22px;
  width: 9px;
  height: 9px;
  border: 2px solid #0a0f1a;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 2px #334155;
  content: '';
}

.ws-summary-card pre,
.ws-export-preview {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: #dbe4f0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

.ws-mobile-nav {
  display: none;
}

.ws-dialog {
  width: min(calc(100% - 28px), 660px);
  max-height: min(88vh, 820px);
  padding: 24px;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface);
  color: #cbd5e1;
  box-shadow: var(--shadow-elevated);
}

.ws-dialog::backdrop {
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(3px);
}

.ws-dialog-head {
  margin-bottom: 18px;
}

.ws-radio-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.ws-radio-list label {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b1220;
  color: #e2e8f0;
  cursor: pointer;
}

.ws-offer {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(96, 165, 250, 0.48);
  border-radius: var(--radius-md);
  background: rgba(30, 64, 175, 0.12);
}

.ws-offer strong {
  color: #fff;
  font-size: 27px;
}

.ws-export-preview {
  max-height: 280px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
  background: #080d17;
  font-size: 12px;
}

.ws-divider {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.ws-danger-zone {
  padding: 18px;
  border: 1px solid rgba(248, 113, 113, 0.38);
  border-radius: var(--radius-md);
  background: rgba(127, 29, 29, 0.12);
}

.ws-danger-zone h3,
.ws-danger-zone p {
  margin-top: 0;
}

.ws-toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  max-width: calc(100vw - 36px);
  padding: 12px 16px;
  border: 1px solid #4ade80;
  border-radius: var(--radius-sm);
  background: #052e16;
  color: #dcfce7;
  box-shadow: var(--shadow-card);
  font-size: 14px;
}

@media (max-width: 768px) {
  .ws-status {
    top: 8px;
    right: 8px;
  }

  .ws-entry {
    align-items: start;
    padding: 58px 12px 24px;
  }

  .ws-entry-card {
    padding: 24px 18px;
    border-radius: var(--radius-lg);
  }

  .ws-entry-card .ws-eyebrow {
    margin-top: 32px;
  }

  .ws-field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ws-shell {
    display: block;
    padding-bottom: 76px;
  }

  .ws-rail {
    display: none;
  }

  .ws-main {
    width: 100%;
    padding: 60px 14px 36px;
  }

  .ws-case-header {
    margin-bottom: 24px;
  }

  .ws-view-heading,
  .ws-charge-card {
    align-items: stretch;
    flex-direction: column;
  }

  .ws-view-heading .ws-button,
  .ws-charge-card .ws-button {
    width: 100%;
  }

  .ws-panel,
  .ws-charge-card,
  .ws-summary-card {
    padding: 18px;
  }

  .ws-metrics {
    grid-template-columns: 1fr;
  }

  .ws-metrics span,
  .ws-metrics button {
    min-height: 60px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .ws-list-item,
  .ws-timeline-item {
    gap: 10px;
  }

  .ws-mobile-nav {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    background: rgba(8, 13, 23, 0.97);
    backdrop-filter: blur(12px);
  }

  .ws-mobile-nav button {
    min-height: 48px;
    justify-content: center;
    padding: 6px 3px;
    font-size: 11px;
    text-align: center;
  }

  .ws-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 20px);
    margin: auto 0 0;
    padding: 20px 16px calc(22px + env(safe-area-inset-bottom));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .ws-dialog .ws-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .ws-dialog .ws-actions .ws-button,
  .ws-dialog .ws-actions a {
    width: 100%;
  }

  .ws-action-spacer {
    display: none;
  }

  .ws-toast {
    right: 12px;
    bottom: 82px;
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 390px) {
  .ws-entry-card h1 {
    font-size: 30px;
  }

  .ws-actions:not(.ws-actions-stack) {
    align-items: stretch;
    flex-direction: column;
  }

  .ws-actions:not(.ws-actions-stack) .ws-button,
  .ws-actions:not(.ws-actions-stack) a {
    width: 100%;
  }

  .ws-panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media print {
  body {
    background: #fff;
    color: #111827;
  }

  .ws-status,
  .ws-rail,
  .ws-mobile-nav,
  .ws-case-header .ws-icon-button,
  .ws-view:not(#view-summary),
  #view-summary .ws-view-heading .ws-button,
  #view-summary .ws-actions,
  .ws-dialog,
  .ws-toast {
    display: none !important;
  }

  .ws-shell,
  .ws-main,
  #view-summary {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .ws-case-header,
  .ws-summary-card {
    display: block;
    border-color: #d1d5db;
    background: #fff;
    box-shadow: none;
  }

  .ws-case-header h1,
  .ws-view h2,
  .ws-summary-card pre {
    color: #111827;
  }
}
