.decoder-page {
  color: var(--ink);
  background: #f4f7f5;
}

.decoder-brand-icon {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 7px;
}

.decoder-main {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.decoder-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.decoder-heading .guide-kicker,
.reference-intro .guide-kicker {
  color: #5f716c;
}

.decoder-heading h1 {
  font-size: 34px;
}

.decoder-heading > div > p:last-child {
  max-width: 690px;
  margin: 10px 0 0;
  color: #51615c;
  font-size: 14px;
  line-height: 1.65;
}

.local-state {
  min-width: 116px;
  min-height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #205941;
  background: #e5f3eb;
  border: 1px solid #b7d8c5;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.local-state span {
  width: 8px;
  height: 8px;
  background: #218c5b;
  border-radius: 50%;
}

.decoder-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #ffffff;
  border: 1px solid #cfd9d5;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(24, 33, 31, 0.06);
}

.decoder-input,
.decoder-output {
  min-width: 0;
  min-height: 505px;
  padding: 24px;
}

.decoder-output {
  background: #f8faf9;
  border-left: 1px solid #dbe3e0;
}

.pane-heading {
  min-height: 50px;
  margin-bottom: 18px;
}

.pane-heading p {
  margin: 0 0 4px;
  color: #71817c;
  font-size: 10px;
  font-weight: 800;
}

.pane-heading h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.output-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

#decoder-form {
  display: grid;
  gap: 9px;
}

#decoder-form label,
.result-scan label {
  color: #34443f;
  font-size: 12px;
  font-weight: 800;
}

#provider,
#error-text,
.result-scan input,
.decoder-actions button,
.result-scan button,
.copy-action {
  border-radius: 6px;
  font: inherit;
  letter-spacing: 0;
}

#provider,
#error-text,
.result-scan input {
  width: 100%;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #bac8c3;
  outline: 0;
}

#provider {
  min-height: 42px;
  padding: 0 11px;
}

#error-text {
  min-height: 190px;
  padding: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

#provider:focus,
#error-text:focus,
.result-scan input:focus {
  border-color: #238b7e;
  box-shadow: 0 0 0 3px rgba(35, 139, 126, 0.13);
}

.privacy-note {
  min-height: 34px;
  margin: 1px 0 3px;
  color: #65746f;
  font-size: 11px;
  line-height: 1.5;
}

.decoder-error {
  margin: 2px 0;
  padding: 9px 11px;
  color: #8f2929;
  background: #fff2f2;
  border-left: 4px solid #bd3d3d;
  font-size: 12px;
  line-height: 1.5;
}

.decoder-actions {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(132px, 1fr) auto auto;
  gap: 8px;
}

.decoder-actions button,
.result-scan button,
.copy-action {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action,
.result-scan button {
  color: #ffffff;
  background: #087e73;
  border-color: #087e73;
}

.primary-action:hover,
.result-scan button:hover {
  background: #075f58;
}

.secondary-action,
.copy-action {
  color: #354640;
  background: #ffffff;
  border-color: #bfcac6 !important;
}

.secondary-action:hover,
.copy-action:hover {
  background: #edf2f0;
}

.copy-action {
  min-width: 102px;
  min-height: 36px;
  padding: 0 10px;
}

.result-empty {
  min-height: 330px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 34px;
  color: #6c7b76;
  text-align: center;
  border: 1px dashed #c3ceca;
  border-radius: 6px;
}

.result-empty strong {
  color: #40504b;
  font-size: 14px;
}

.result-empty p {
  max-width: 360px;
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.65;
}

.result-meta {
  min-height: 31px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #677671;
  font-size: 11px;
}

.result-meta code {
  font-size: 11px;
}

.status-chip {
  min-height: 25px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c3ceca;
  border-radius: 5px;
  font-weight: 800;
}

.status-temporary {
  color: #745408;
  background: #fff6d9;
  border-color: #e5c86c;
}

.status-permanent {
  color: #8a2929;
  background: #fff0f0;
  border-color: #e1acac;
}

.status-success {
  color: #205941;
  background: #e5f3eb;
  border-color: #b7d8c5;
}

.status-unknown {
  color: #44544f;
  background: #edf1f0;
}

#result-title {
  margin: 15px 0 8px;
  font-size: 21px;
  line-height: 1.3;
}

.result-explanation,
.next-action p,
.result-warning {
  color: #465650;
  font-size: 13px;
  line-height: 1.65;
}

.result-explanation {
  min-height: 64px;
  margin: 0 0 15px;
}

.next-action {
  padding: 12px 0 12px 14px;
  border-left: 4px solid #2873b8;
}

.next-action strong {
  color: #23332e;
  font-size: 11px;
  text-transform: uppercase;
}

.next-action p {
  margin: 4px 0 0;
}

.result-warning {
  margin: 12px 0 0;
  padding: 9px 11px;
  color: #6c4f0c;
  background: #fff8e4;
  border: 1px solid #ead89f;
  border-radius: 5px;
}

.result-links {
  min-height: 38px;
  margin: 14px 0 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12px;
}

.guide-link {
  font-weight: 800;
}

.result-scan {
  padding-top: 13px;
  display: grid;
  gap: 8px;
  border-top: 1px solid #d9e1de;
}

.result-scan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 7px;
}

.result-scan input,
.result-scan button {
  min-height: 42px;
}

.result-scan input {
  min-width: 0;
  padding: 0 10px;
  font-size: 12px;
}

.result-scan button {
  grid-column: 1 / -1;
}

.decoder-reference {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid #ced8d4;
}

.reference-intro h2 {
  margin: 0;
  font-size: 23px;
}

.reference-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  background: #ffffff;
  border: 1px solid #d2dcd8;
  border-radius: 7px;
  overflow: hidden;
}

.reference-grid > div {
  min-width: 0;
  min-height: 150px;
  padding: 18px;
}

.reference-grid > div + div {
  border-left: 1px solid #dce4e1;
}

.reference-grid strong,
.reference-grid span {
  display: block;
}

.reference-grid strong {
  color: #0b665e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 21px;
}

.reference-grid span {
  margin-top: 5px;
  color: #2f403a;
  font-size: 12px;
  font-weight: 800;
}

.reference-grid p,
.reference-sources {
  color: #596963;
  font-size: 12px;
  line-height: 1.65;
}

.reference-sources {
  margin: 15px 0 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 780px) {
  .decoder-heading {
    align-items: start;
  }

  .decoder-workbench {
    grid-template-columns: 1fr;
  }

  .decoder-input,
  .decoder-output {
    min-height: 0;
  }

  .decoder-output {
    border-top: 1px solid #dbe3e0;
    border-left: 0;
  }

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

  .reference-grid > div {
    min-height: 0;
  }

  .reference-grid > div + div {
    border-top: 1px solid #dce4e1;
    border-left: 0;
  }
}

@media (max-width: 540px) {
  .decoder-main {
    width: min(100% - 24px, 1080px);
    padding-top: 24px;
  }

  .decoder-heading {
    display: grid;
    gap: 14px;
  }

  .decoder-heading h1 {
    font-size: 30px;
  }

  .local-state {
    width: max-content;
  }

  .decoder-input,
  .decoder-output {
    padding: 18px;
  }

  .decoder-actions,
  .result-scan-row {
    grid-template-columns: 1fr;
  }

  .decoder-actions button,
  .result-scan button {
    width: 100%;
  }

  .output-heading {
    align-items: center;
  }
}
