.editor-page {
  max-width: 1390px;
  margin: auto;
  padding: 38px 32px 0;
}
.editor-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.editor-intro h1 {
  font-size: clamp(2rem, 3.2vw, 3rem);
  margin: 0 0 10px;
}
.editor-intro p {
  margin: 0;
  font-size: 0.95rem;
}
.editor-intro .eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.17em;
  font-weight: 750;
  color: var(--teal);
  margin-bottom: 10px;
}
.privacy-pill,
.section-tag {
  white-space: nowrap;
  background: #e8f1e9;
  border: 1px solid #d4e3d6;
  border-radius: 30px;
  padding: 7px 13px;
  font-size: 0.75rem;
  color: #285d44;
  font-weight: 650;
}
.privacy-pill span {
  font-size: 0.65rem;
  margin-right: 7px;
}
.project-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  background: #edf1eb;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.template-actions,
.export-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
button,
.file-button {
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.4;
  border: 1px solid #cdd8ce;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 600;
}
button:hover,
.file-button:hover {
  background: #e4eee8;
  border-color: #90afa0;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.primary-button,
#download {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
#download:hover,
.primary-button:hover {
  background: #145b57;
}
.file-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
.file-button:focus-within {
  outline: 3px solid #1a8e86;
  outline-offset: 3px;
}
.project-state {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 3px 6px;
  font-size: 0.82rem;
}
.project-state strong {
  font-weight: 700;
}
.project-state span {
  color: var(--muted);
  margin-left: auto;
}
#status {
  font-size: 0.82rem;
  color: var(--teal);
  margin: 5px 3px 15px;
  overflow-wrap: anywhere;
}
.workspace {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  border: 1px solid #d2ded3;
  border-radius: 14px;
  overflow: hidden;
  min-height: 550px;
  background: white;
  box-shadow: 0 8px 28px #153b2810;
}
.workspace-nav {
  background: #f1f4ef;
  padding: 17px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.workspace-nav button {
  text-align: left;
  border: none;
  background: transparent;
  padding: 12px 13px;
  font-size: 0.86rem;
  color: #4d6862;
}
.workspace-nav button[aria-selected="true"] {
  background: white;
  color: var(--teal);
  box-shadow: 0 1px 6px #24442a13;
  font-weight: 750;
}
.nav-note {
  margin-top: auto;
  padding: 24px 13px 5px;
  font-size: 0.78rem;
  line-height: 1.8;
  color: #809184;
}
.workspace-body {
  min-width: 0;
}
.workspace-panel {
  padding: 28px;
  min-width: 0;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.panel-heading h2 {
  font-size: 1.5rem;
  margin: 0 0 9px;
}
.panel-heading p {
  font-size: 0.88rem;
  margin: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px 20px;
  margin-bottom: 23px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.76rem;
  color: #4b625c;
  font-weight: 600;
  min-width: 0;
}
input,
select,
textarea {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  width: 100%;
  min-width: 0;
  border: 1px solid #cad6cc;
  border-radius: 6px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
}
input:disabled,
select:disabled {
  background: #f0f3ee;
}
.export-label select {
  font-size: 0.82rem;
  min-width: 142px;
}
.identity-note {
  font-size: 0.82rem;
  background: #f5f7f1;
  border-left: 3px solid #a8c3a9;
  padding: 14px 16px;
  margin-top: 25px;
  color: #5c7165;
}
.split-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 1fr);
  gap: 24px;
}
.table-scroll {
  overflow: auto;
  min-width: 0;
  max-height: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.parameter-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.parameter-table th {
  padding: 12px 13px;
  text-align: left;
  background: #f5f7f3;
  font-size: 0.72rem;
  color: #677b6c;
}
.parameter-table td {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}
.parameter-table tr.selected td {
  background: #eaf3ec;
}
.parameter-table td button {
  border: none;
  background: none;
  text-align: left;
  padding: 0;
  white-space: normal;
  font-size: 0.82rem;
}
.parameter-table code {
  background: none;
  padding: 0;
  border: 0;
  font-size: 0.74rem;
  color: #6e806f;
  display: block;
  margin-top: 3px;
}
.search-label {
  margin-bottom: 18px;
  max-width: 360px;
}
.detail-editor {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
  background: #fafbf8;
}
.detail-editor h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 16px;
}
.detail-editor .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.detail-editor > label {
  margin-bottom: 13px;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.remove {
  color: #8c534b;
}
.empty-note {
  font-size: 0.84rem;
  padding: 17px;
  color: var(--muted);
}
.process-record {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
}
.record-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.record-heading h3 {
  font-size: 0.95rem;
  margin: 0;
}
.bit-layout {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 3px;
  margin: 16px 0;
}
.bit-cell {
  height: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  font:
    10px ui-monospace,
    monospace;
  background: #f0f2ec;
  color: #78877a;
  border-radius: 3px;
}
.bit-cell.field-0 {
  background: #b9dacc;
  color: #215846;
}
.bit-cell.field-1 {
  background: #d1d0ec;
  color: #474171;
}
.bit-cell.field-2 {
  background: #ead5b7;
  color: #715127;
}
.bit-cell.field-3 {
  background: #bcdde8;
  color: #2b6070;
}
.field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.field-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
}
.field-chip.selected {
  border-color: var(--teal);
  background: #e8f2e8;
}
.field-chip span {
  font:
    11px ui-monospace,
    monospace;
  color: #6d7f6f;
}
.field-chip i {
  width: 9px;
  height: 9px;
  background: #b9dacc;
  border-radius: 50%;
}
.text-toolbar {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
.text-list,
.item-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  max-height: 410px;
}
.text-list button,
.item-list button {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 15px;
}
.text-list button span {
  font-weight: 400;
  display: block;
  color: #6c7c71;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-list button.selected {
  background: #e9f2e9;
}
.event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.event-grid h3 {
  font-size: 1rem;
}
.event-grid .detail-editor {
  margin-top: 16px;
}
.asset-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.asset-item span {
  color: #70806f;
  font-size: 0.78rem;
}
.comparison-box {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 24px;
}
.comparison-box h3 {
  font-size: 1rem;
}
.comparison-box pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.75rem;
}
.coverage-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.coverage-row span {
  font-size: 0.75rem;
  padding: 6px 10px;
  background: #edf3eb;
  border-radius: 5px;
}
.coverage-row .unchecked {
  background: #f3efe8;
  color: #786344;
}
#checks {
  padding-left: 21px;
  font-size: 0.87rem;
  overflow-wrap: anywhere;
}
#checks li {
  margin-bottom: 12px;
}
.check-error {
  color: #a4352c;
}
.check-warning {
  color: #76816e;
}
#xml-source {
  height: 475px;
  font:
    12px/1.75 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  resize: vertical;
  white-space: pre;
  overflow: auto;
  background: #f7faf5;
  border-color: #d9e2d5;
}
textarea {
  resize: vertical;
}
.small-note {
  font-size: 0.75rem !important;
  color: #798572;
  margin-top: 15px;
}
.editor-help {
  padding: 22px 0 5px;
  font-size: 0.83rem;
}
.editor-help p {
  margin-bottom: 8px;
}
.editor-footer {
  max-width: 1390px;
  margin: auto;
  padding: 17px 32px 25px;
  font-size: 0.8rem;
  color: var(--muted);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
@media (max-width: 1000px) {
  .editor-page {
    padding: 28px 22px 0;
  }
  .split-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .detail-editor .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .project-toolbar {
    gap: 14px;
  }
  .export-actions {
    margin-left: auto;
  }
  .workspace {
    grid-template-columns: 155px minmax(0, 1fr);
  }
  .workspace-panel {
    padding: 23px;
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bit-layout {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .editor-page {
    padding: 24px 14px 0;
  }
  .editor-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }
  .privacy-pill {
    font-size: 0.68rem;
    padding: 5px 10px;
  }
  .editor-intro p {
    font-size: 0.83rem;
  }
  .workspace {
    display: block;
    min-height: 0;
  }
  .workspace-nav {
    flex-direction: row;
    overflow: auto;
    gap: 4px;
    padding: 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace-nav button {
    white-space: nowrap;
    padding: 9px 11px;
    font-size: 0.78rem;
  }
  .nav-note {
    display: none;
  }
  .workspace-panel {
    padding: 19px 15px;
  }
  .panel-heading {
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 21px;
  }
  .panel-heading h2 {
    font-size: 1.3rem;
  }
  .panel-heading p {
    font-size: 0.8rem;
  }
  .project-toolbar {
    padding: 11px;
  }
  .template-actions,
  .export-actions {
    width: 100%;
    gap: 7px;
  }
  .template-actions > button {
    flex: 1;
  }
  .template-actions .file-button {
    width: 100%;
  }
  .export-actions > button {
    flex: 1;
  }
  .export-actions .export-label {
    flex: 1.2;
  }
  .export-label select {
    min-width: 0;
    font-size: 0.76rem;
  }
  .project-state {
    align-items: flex-start;
    font-size: 0.75rem;
    gap: 10px;
  }
  .project-state span {
    max-width: 45%;
    text-align: right;
  }
  .form-grid,
  .detail-editor .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
  .event-grid {
    grid-template-columns: 1fr;
  }
  .text-toolbar {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
  }
  .detail-editor {
    padding: 14px;
  }
  .editor-footer {
    padding-inline: 14px;
  }
  .bit-cell {
    font-size: 9px;
  }
  .record-heading {
    flex-wrap: wrap;
  }
  .parameter-table td,
  .parameter-table th {
    padding: 10px 8px;
  }
  .asset-item {
    flex-direction: column;
    gap: 3px;
  }
}
@media (max-width: 360px) {
  .form-grid,
  .detail-editor .form-grid {
    grid-template-columns: 1fr;
  }
  .export-actions {
    flex-wrap: wrap;
  }
  .export-actions #save-project {
    flex: 1 1 100%;
  }
  .project-state {
    flex-direction: column;
    gap: 3px;
  }
  .project-state span {
    max-width: none;
    text-align: left;
    margin-left: 0;
  }
  .text-toolbar {
    grid-template-columns: 1fr;
  }
  .panel-heading h2 {
    font-size: 1.2rem;
  }
}
.tree-workspace {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr);
  gap: 20px;
  margin-top: 20px;
}
.document-tree {
  max-height: 640px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}
.document-tree button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 2px 0;
  border: 0;
  background: none;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}
.document-tree button.selected {
  background: #e8f1e9;
  color: var(--teal);
}
#node-editor form + form {
  margin-top: 24px;
}
#snippet-preview {
  max-height: 540px;
  overflow: auto;
  margin-top: 20px;
}
#snippet-preview button {
  display: block;
  text-align: left;
  margin-top: 6px;
}
.validation-options fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 20px;
}
.validation-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 14px;
}
.validation-options input[type="checkbox"] {
  width: auto;
}
.rules-list {
  padding-left: 20px;
}
.rules-list li {
  overflow-wrap: anywhere;
  margin-top: 10px;
}
.rules-list button {
  margin-left: 12px;
}
#firmware-result {
  overflow-wrap: anywhere;
}
@media (max-width: 1000px) {
  .tree-workspace {
    grid-template-columns: 1fr;
  }
  .document-tree {
    max-height: 300px;
  }
}
