.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(220, 228, 238, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(247, 249, 252, 0.94)),
    var(--surface-container);
}

.composer textarea {
  resize: none;
  min-height: 50px;
  max-height: 96px;
  padding: 12px 13px;
  line-height: 1.35;
  border: 1px solid rgba(220, 228, 238, 0.95);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}

.composer button {
  min-height: 50px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #1646c7);
  font-size: 18px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.composer button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.context-footer {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(120px, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 10px;
  padding: 9px 12px 11px;
  border-top: 1px solid rgba(220, 228, 238, 0.92);
  background: #fbfdff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.context-footer > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-footer-label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0;
}

.context-footer strong {
  min-width: 0;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-footer-meter {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(22, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.78);
}

.context-footer-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), var(--secondary), var(--primary));
  transition: width 180ms ease;
}

.context-footer-meta {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector {
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.inspector-view {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspector-page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1fr);
  align-content: start;
  gap: 16px;
}

.inspector-page .version-panel {
  grid-column: 1 / -1;
}

.inspector-section-wide {
  grid-column: 1 / -1;
}

.inspector-section-wide .preview {
  min-height: 260px;
}

.inspector-section {
  display: grid;
  gap: 10px;
}

.version-panel {
  padding-top: 4px;
}

.version-label {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius);
  background: var(--surface-tonal);
  color: var(--primary-dark);
  box-shadow: none;
  text-align: left;
}

.version-label:hover {
  border-color: rgba(37, 99, 235, 0.38);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: none;
  transform: none;
}

.version-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.version-label strong {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-section.collapsed {
  gap: 0;
}

.inspector-section.collapsed .check-list,
.inspector-section.collapsed .rule-list,
.inspector-section.collapsed .preview {
  display: none;
}

.reference-panel {
  display: grid;
  gap: 10px;
}

.reference-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.file-button {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  text-align: center;
}

.file-button.disabled {
  border-color: var(--line);
  background: var(--surface-container);
  color: var(--muted);
  cursor: wait;
  box-shadow: none;
}

.reference-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
}

.reference-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 160ms ease;
}

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

.reference-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reference-summary {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(15, 159, 110, 0.32);
  border-radius: var(--radius);
  background: #ecfdf5;
  color: #064e3b;
  padding: 10px;
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.reference-summary[hidden] {
  display: none;
}

.check-list,
.rule-list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.workflow-item {
  display: grid;
  grid-template-columns: 22px 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.workflow-item input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--primary);
}

.workflow-item:has(input:checked) {
  border-color: rgba(15, 159, 110, 0.44);
  background: #ecfdf5;
  box-shadow:
    inset 3px 0 0 var(--success),
    var(--shadow-1);
}

.workflow-item:has(input:checked) .workflow-icon {
  background: #d1fae5;
}

.workflow-item strong,
.rule-item strong {
  color: var(--ink);
  font-size: 13px;
}

.workflow-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.rule-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border-left: 4px solid var(--tertiary);
  cursor: default;
}

.rule-icon {
  background: var(--tertiary-soft);
}

.rule-item:hover {
  transform: none;
  border-color: var(--line);
  border-left-color: var(--tertiary);
  background: var(--surface);
}

.preview {
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f172a;
  padding: 12px;
  white-space: pre-wrap;
  color: #e2e8f0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
