.group-toolbar, .group-tabs, .group-breadcrumbs, .group-folder-list, .group-row-actions { display:flex; flex-wrap:wrap; align-items:center; gap:.7rem; }
.group-toolbar { justify-content:space-between; margin-bottom:1rem; }
.group-workspace { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,340px); gap:1rem; align-items:start; }
.group-main, .group-conversation { min-width:0; }
.group-tabs { padding:.8rem 1rem; border-bottom:1px solid var(--line); }
.group-tabs [aria-current] { font-weight:700; text-decoration-thickness:3px; }
.group-breadcrumbs, .group-folder-list { margin-bottom:1rem; overflow-wrap:anywhere; }
.group-breadcrumbs a+a::before { content:"/"; color:var(--muted); margin-right:.7rem; }
.group-tools { margin:1rem 0; }
.group-tools summary { cursor:pointer; color:var(--brand); }
.group-tools form { margin-top:1rem; }
.group-message { padding:1rem 0; border-bottom:1px solid var(--line); }
.group-message h3 { font-size:.9rem; margin:.5rem 0; }
.group-message-text { white-space:pre-wrap; overflow-wrap:anywhere; }
.group-message small { color:var(--muted); }
.group-conversation form { margin-top:1rem; }
.group-upload { margin-top:2rem; padding-top:1rem; border-top:1px solid var(--line); }
.group-row-actions form { margin:.5rem 0; }
.group-workspace input, .group-workspace select, .group-workspace textarea { max-width:100%; }
@media(max-width:1000px) { .group-workspace { grid-template-columns:1fr; } }
:root {
  color-scheme: light;
  --bg: #f1f3f5;
  --surface: #ffffff;
  --surface-muted: #f7f8f9;
  --text: #17202a;
  --muted: #5e6975;
  --line: #cfd5dc;
  --line-strong: #aeb7c2;
  --brand: #173f5f;
  --brand-strong: #0d2d46;
  --accent: #147d73;
  --focus: #f0a202;
  --radius: 3px;
  --shadow: 0 1px 2px rgb(23 32 42 / 8%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brand);
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--brand-strong);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.55rem 0.8rem;
  color: #fff;
  background: var(--brand-strong);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  color: #fff;
  background: var(--brand-strong);
  border-bottom: 3px solid var(--accent);
}

.brand-row {
  min-height: 4rem;
  padding: 0.65rem clamp(1rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  min-width: 2.7rem;
  padding: 0.38rem 0.4rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 55%);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.08rem;
  line-height: 1.2;
}

.brand small,
.phase-label {
  color: #cbd8e3;
  font-size: 0.75rem;
}

.phase-label {
  padding: 0.25rem 0.5rem;
  border: 1px solid rgb(255 255 255 / 28%);
}

.session-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
}

.session-summary form {
  margin: 0;
}

.session-user {
  max-width: min(22rem, 45vw);
  overflow: hidden;
  color: #dce6ee;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-nav {
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  display: flex;
  align-items: stretch;
  gap: 0.1rem;
  overflow-x: auto;
  background: #143750;
  scrollbar-width: thin;
}

.primary-nav a {
  padding: 0.64rem 0.68rem 0.57rem;
  flex: 0 0 auto;
  color: #e8eef3;
  border-bottom: 3px solid transparent;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav a:hover {
  color: #fff;
  background: rgb(255 255 255 / 7%);
}

.primary-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: #54c5b8;
  background: rgb(255 255 255 / 10%);
}

.primary-nav .nav-login {
  margin-left: auto;
}

.page-shell {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 2rem;
  flex: 1;
}

.page-heading {
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line-strong);
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-heading p {
  max-width: 80ch;
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(15rem, 1fr);
  gap: 1rem;
  align-items: start;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header {
  min-height: 2.8rem;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.panel h2 {
  margin: 0;
  font-size: 1rem;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid #e4e8ec;
  text-align: left;
  vertical-align: middle;
}

thead th {
  color: #46515d;
  background: #fafbfc;
  font-size: 0.72rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

tbody th {
  font-weight: 650;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f8fafb;
}

.table-subline {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 400;
}

.status {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.status-neutral {
  color: #5e6975;
  background: #f2f4f6;
}

.status-active {
  color: #135c55;
  background: #edf9f7;
}

.status-success {
  color: #28623f;
  background: #eff8f2;
}

.status-warning {
  color: #76520c;
  background: #fff8e8;
}

.status-danger {
  color: #8a2525;
  background: #fff1f1;
}

.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  gap: 1rem;
  align-items: start;
}

.case-history {
  grid-column: 1 / -1;
}

.detail-grid,
.detail-stack {
  margin: 0;
}

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

.detail-grid > div,
.detail-stack > div {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #e4e8ec;
}

.detail-grid > div {
  border-right: 1px solid #e4e8ec;
}

.detail-grid > div:nth-child(3n) {
  border-right: 0;
}

.detail-grid > div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.detail-stack > div:last-child {
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

dd {
  margin: 0.22rem 0 0;
  font-weight: 600;
}

.case-description,
.panel-copy {
  padding: 0.85rem;
}

.case-description h3,
.case-description p,
.panel-copy {
  margin: 0;
}

.case-description p {
  margin-top: 0.4rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  padding: 0.7rem 0.85rem;
  display: grid;
  grid-template-columns: 9.5rem minmax(12rem, 1fr) minmax(8rem, auto);
  gap: 0.8rem;
  border-bottom: 1px solid #e4e8ec;
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline time,
.timeline span {
  color: var(--muted);
  font-size: 0.82rem;
}

.action-list {
  display: grid;
}

.action-list a {
  padding: 0.72rem 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e4e8ec;
  font-weight: 650;
  text-decoration: none;
}

.action-list a:last-child {
  border-bottom: 0;
}

.action-list a:hover {
  background: var(--surface-muted);
}

.empty-state {
  min-height: 8rem;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.empty-state p {
  max-width: 70ch;
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.button-link,
button {
  min-height: 2.45rem;
  padding: 0.55rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button-link:hover,
button:hover {
  color: #fff;
  background: var(--brand-strong);
}

.button-quiet {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  color: #fff;
  background: transparent;
  border-color: rgb(255 255 255 / 45%);
  font-size: 0.78rem;
}

.button-quiet:hover {
  background: rgb(255 255 255 / 10%);
}

.button-secondary {
  color: var(--brand);
  background: #fff;
}

.button-secondary:hover {
  color: var(--brand-strong);
  background: var(--surface-muted);
}

.form-panel {
  max-width: 38rem;
  padding: 1rem;
}

.form-panel-wide {
  max-width: 62rem;
}

.panel-form-body {
  padding: 1rem;
}

.connection-summary {
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.connection-summary > div {
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border-right: 1px solid var(--line);
}

.connection-summary > div:last-child {
  border-right: 0;
}

.connection-summary dd {
  overflow-wrap: anywhere;
}

.form-message {
  margin: 0 0 1rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 0.87rem;
}

.process-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(0, 3fr);
  gap: 1rem;
  align-items: start;
}

.process-settings-nav {
  margin: 0 0 1rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.process-settings-nav a {
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-weight: 700;
}

.process-settings-nav a:hover,
.process-settings-nav a[aria-current="page"] {
  color: var(--brand-strong);
  border-bottom-color: var(--brand);
}

.process-versions {
  display: grid;
  gap: 1rem;
}

.companion-view section + section,
.companion-view > form,
.companion-fields > section {
  margin-top: 1rem;
}

.companion-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.companion-view .panel-header { flex-wrap: wrap; overflow-wrap: anywhere; }
.companion-view textarea { font-family: ui-monospace, monospace; font-size: .82rem; }
.companion-code { padding: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; }
.dmn-table th small { display: block; font-weight: 400; color: var(--muted); }
.dmn-table td { min-width: 10rem; }
.dmn-table .dmn-output { background: #edf5fb; }
.dmn-table textarea { min-width: 9rem; }

.process-section,
.validation-report,
.process-actions {
  padding: 0.85rem;
  border-top: 1px solid var(--line);
}

.process-section h3,
.validation-report h3 {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
}

.process-section > p {
  margin: 0;
  color: var(--muted);
}

.resource-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-import-editor input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-height: 0;
  margin: 0 .45rem 0 0;
  vertical-align: middle;
}

.process-import-editor .resource-list li {
  flex-wrap: wrap;
  gap: .35rem .75rem;
  overflow-wrap: anywhere;
}

.process-import-editor > .panel + .panel {
  margin-top: 1rem;
}

.resource-list li {
	flex-wrap: wrap;
	overflow-wrap: anywhere;
  padding: 0.4rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e4e8ec;
}

.resource-list li:last-child {
  border-bottom: 0;
}

.resource-list span,
.validation-report span {
  color: var(--muted);
}

.validation-report {
  color: #652323;
  background: #fff8f8;
}

.validation-report ol {
  margin: 0;
  padding-left: 1.5rem;
}

.validation-report li + li {
  margin-top: 0.55rem;
}

.process-actions {
  display: flex;
  gap: 0.7rem;
}

.process-actions form {
  margin: 0;
}

.configuration-form {
  padding: 0.85rem;
  border-top: 1px solid var(--line);
}

.configuration-form fieldset {
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  border: 0;
}

.configuration-form legend {
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.hash-value {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.75rem;
}

.form-error {
  color: #7d1f1f;
  background: #fff3f3;
  border-color: #d9a2a2;
}

.form-notice {
  color: #244f3d;
  background: #effaf5;
  border-color: #9bc8b5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.field {
  display: grid;
  gap: 0.3rem;
}

.field-span {
  grid-column: 1 / -1;
}

label {
  font-size: 0.83rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.5rem 0.6rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #7d8996;
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.compact-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.compact-actions form {
  margin: 0;
}

.communication-body {
  margin-top: 0.35rem;
  max-width: 56rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.communication-detail-body {
  grid-column: 1 / -1;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.communication-detail-body p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.form-actions small,
.required-note {
  color: var(--muted);
}

.required-note {
  margin: 0 0 0.8rem;
  font-size: 0.8rem;
}

.role-configuration {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: #f8f9fa;
}

.role-configuration h3 {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
}

.case-timeline,
.case-process-diagram {
  grid-column: 1 / -1;
}

.case-process-diagram .process-diagram {
  border: 0;
}

.process-diagram {
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}

.process-diagram img {
  display: block;
  min-width: 38rem;
  width: 100%;
  height: auto;
}

.repeatable-row {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: #f8f9fa;
}

.app-footer {
  padding: 0.8rem clamp(1rem, 3vw, 2.5rem);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  background: #e8ebee;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}

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

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

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

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

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

  .connection-summary > div:nth-child(2) {
    border-right: 0;
  }

  .connection-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .case-history {
    grid-column: auto;
  }

  .primary-nav .nav-login {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .phase-label {
    display: none;
  }

  .session-summary {
    gap: 0.4rem;
  }

  .session-user {
    max-width: 10rem;
  }

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

  .connection-summary {
    grid-template-columns: 1fr;
  }

  .connection-summary > div,
  .connection-summary > div:nth-child(2),
  .connection-summary > div:nth-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .connection-summary > div:last-child {
    border-bottom: 0;
  }

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

  .detail-grid > div,
  .detail-grid > div:nth-child(3n),
  .detail-grid > div:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid #e4e8ec;
  }

  .detail-grid > div:last-child {
    border-bottom: 0;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .field-span {
    grid-column: auto;
  }

  .empty-state,
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
