:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #172b3a;
  background: #f4f6f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 4% 0%, rgb(45 132 117 / 9%), transparent 35rem),
    #f4f6f8;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 28px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #c6ded8;
  border-radius: 16px;
  background: #e5f1ed;
  color: #247b6c;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 18px;
  font-weight: 500;
}

.eyebrow {
  margin: 0 0 6px;
  color: #378b7a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 32px);
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.subtitle {
  margin: 8px 0 0;
  color: #647482;
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.editor-card {
  display: flex;
  min-width: 0;
  min-height: 440px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid #dce3e8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 30px rgb(30 51 66 / 4%);
}

.card-heading,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-heading {
  min-height: 25px;
  margin-bottom: 14px;
}

.card-heading label {
  font-size: 13px;
  font-weight: 700;
}

.hint {
  color: #84919b;
  font-size: 11px;
}

textarea {
  width: 100%;
  min-height: 0;
  flex: 1;
  resize: vertical;
  padding: 15px;
  border: 1px solid #e1e7eb;
  border-radius: 9px;
  outline: none;
  background: #f9fbfc;
  color: #263e4d;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  tab-size: 2;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea:focus {
  border-color: #64a99b;
  box-shadow: 0 0 0 3px rgb(66 148 130 / 12%);
}

textarea::placeholder {
  color: #a3afb7;
}

#json-output {
  background: #f5f9f8;
}

.card-footer {
  min-height: 42px;
  margin-top: 14px;
}

.status {
  margin: 0;
  color: #84919b;
  font-size: 11px;
}

.status.is-error {
  color: #b74747;
}

.status.is-success {
  color: #287e6e;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: #247b6c;
  color: #fff;
}

.button-primary:hover {
  background: #1c685b;
}

.button-upload {
  min-height: 34px;
  border-color: #dce5e8;
  background: #fff;
  color: #526674;
}

.button-upload:hover {
  background: #f0f5f4;
}

.button-upload > span:first-child {
  font-size: 16px;
  line-height: 1;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

dialog {
  width: min(440px, calc(100% - 32px));
  padding: 26px;
  border: 1px solid #dce3e8;
  border-radius: 14px;
  color: #172b3a;
  box-shadow: 0 16px 60px rgb(30 51 66 / 20%);
}

dialog::backdrop {
  background: rgb(20 38 48 / 45%);
}

dialog h2 {
  margin: 0;
  font-size: 21px;
}

.dialog-description {
  margin: 9px 0 22px;
  color: #647482;
  font-size: 13px;
}

dialog label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

dialog input {
  width: 100%;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid #dce3e8;
  border-radius: 8px;
  font-size: 13px;
}

dialog input:focus-visible {
  outline: 2px solid #64a99b;
  outline-offset: 2px;
}

#upload-status {
  min-height: 30px;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.page-footer {
  margin-top: 18px;
  color: #8b98a1;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 32px, 540px);
    padding-top: 40px;
  }

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

  .editor-card {
    min-height: 350px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    width: calc(100% - 24px);
    padding-top: 28px;
  }

  .page-header {
    align-items: flex-start;
    gap: 13px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .editor-card {
    min-height: 320px;
    padding: 15px;
  }

  .card-footer {
    align-items: flex-start;
  }

  .status {
    max-width: 45%;
    padding-top: 8px;
  }
}
