:root {
  color-scheme: light;
  --page: #f5f7f8;
  --surface: #fff;
  --surface-muted: #f8fafb;
  --text: #203142;
  --muted: #697988;
  --line: #dbe2e7;
  --accent: #23689b;
  --accent-soft: #e9f3fb;
  --ready: #e3f1e2;
  --warning: #fff1cc;
  --danger: #fbe2e4;
  --info: #e1efff;
  --closed: #ececed;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font:
    14px/1.4 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.app-shell {
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 2vw, 28px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.identity strong,
.identity small {
  display: block;
}
.identity strong {
  font-size: 16px;
  font-weight: 650;
}
.identity small {
  color: var(--muted);
  font-size: 12px;
}
.mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #223d55;
  color: #fff;
  font-weight: 700;
}
.system-state {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pill,
.problem-counter {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.problem-counter {
  border: 0;
  background: var(--danger);
  color: #8b343c;
}
.sync-state {
  color: var(--muted);
  font-size: 12px;
}
.tabs {
  display: flex;
  gap: 3px;
  padding: 0 clamp(12px, 2vw, 24px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  min-width: max-content;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 13px 15px 10px;
  background: transparent;
  color: var(--muted);
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  border-bottom-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}
.content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px clamp(12px, 2vw, 28px);
}
.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}
h1 {
  margin: 0 0 3px;
  font-size: 21px;
}
.intro p {
  margin: 0;
  color: var(--muted);
}
.intro-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.search-label {
  font-size: 12px;
  color: var(--muted);
}
input,
select {
  min-height: 38px;
  border: 1px solid #bdcbd6;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}
input {
  min-width: 220px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.7fr);
  gap: 15px;
  align-items: start;
}
.table-panel,
.detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  overflow: hidden;
}
.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}
.table-scroll {
  max-height: min(68vh, 780px);
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 690px;
}
th,
td {
  text-align: left;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
td {
  font-size: 13px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover td {
  box-shadow: inset 0 -2px 0 #a3c5dd;
}
tbody tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
tbody tr.tone-ready {
  background: var(--ready);
}
tbody tr.tone-warning {
  background: var(--warning);
}
tbody tr.tone-danger {
  background: var(--danger);
}
tbody tr.tone-info {
  background: var(--info);
}
tbody tr.tone-closed {
  background: var(--closed);
}
.row-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-weight: 600;
}
.row-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.detail-head {
  padding: 17px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 700;
}
h2 {
  margin: 5px 0;
  font-size: 18px;
  line-height: 1.25;
}
.detail-head p {
  margin: 0;
  color: var(--muted);
}
.detail-content {
  max-height: min(70vh, 820px);
  overflow-y: auto;
  padding: 16px;
}
.detail-section {
  margin: 0 0 20px;
}
.detail-section:last-child {
  margin-bottom: 0;
}
.detail-section h3 {
  margin: 0 0 9px;
  font-size: 13px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.fact {
  min-width: 0;
}
.fact span,
.fact strong {
  display: block;
  overflow-wrap: anywhere;
}
.fact span {
  color: var(--muted);
  font-size: 11px;
}
.fact strong {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
}
.member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.member:last-child {
  border-bottom: 0;
}
.member small {
  display: block;
  color: var(--muted);
}
.action-preview {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.action-preview button,
.print-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 5px 8px;
  font-size: 11px;
}
.action-preview button:disabled,
.print-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.status-note {
  padding: 10px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: #21547a;
}
.notice {
  color: var(--muted);
  font-size: 12px;
  margin-top: 13px;
}
.empty {
  padding: 22px 13px;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--text);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--accent);
  color: white;
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0;
}
.login-panel {
  width: min(420px, 92vw);
  margin: 12vh auto;
  padding: 28px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
form label {
  display: block;
  margin: 12px 0;
  color: var(--muted);
}
form label input,
form label select,
form label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
}
input[type="checkbox"] {
  min-width: 18px;
  min-height: 18px;
  width: 18px;
  height: 18px;
}
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 80px;
  padding: 8px;
  font: inherit;
}
dialog {
  width: min(850px, 94vw);
  max-height: 88vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  color: var(--text);
}
dialog::backdrop {
  background: #14253666;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.message,
#message {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  white-space: pre-wrap;
}
.error,
#login-error {
  color: #982735;
}
.full-width {
  width: 100%;
}
.selection-row {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.selection-row select {
  min-width: 0;
  max-width: 100%;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
details {
  margin: 14px 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
}
.document-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0;
}
@media (max-width: 600px) {
  .form-grid,
  .selection-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 930px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .table-scroll,
  .detail-content {
    max-height: none;
  }
}
@media (max-width: 600px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .system-state {
    justify-content: flex-start;
  }
  .intro-actions {
    width: 100%;
  }
  input {
    flex: 1;
    min-width: 150px;
  }
  .facts {
    grid-template-columns: 1fr;
  }
}
