:root {
  color: #172033;
  background: #f6f7fb;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: 20px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.9), rgb(237 242 255 / 0.7)),
    #f6f7fb;
}

.toolbar,
.panel {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 240px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid #d9e1f2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgb(31 41 55 / 0.08);
}

.field,
.toggle {
  display: grid;
  gap: 6px;
  color: #536078;
  font-size: 13px;
  font-weight: 650;
}

.toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 42px;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c8d2e6;
  border-radius: 6px;
  padding: 0 12px;
  color: #172033;
  background: #fbfcff;
}

.field input:focus,
.field select:focus,
textarea:focus {
  outline: 3px solid rgb(59 130 246 / 0.18);
  border-color: #3b82f6;
}

.panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.86fr) minmax(320px, 1.14fr);
  gap: 16px;
  margin-top: 16px;
}

.editor-column,
.preview-column {
  min-width: 0;
  border: 1px solid #d9e1f2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgb(31 41 55 / 0.08);
}

.panel-heading {
  padding: 16px 16px 12px;
  border-bottom: 1px solid #edf1f7;
}

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

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  color: #172033;
  font-size: 17px;
  line-height: 1.3;
}

.panel-heading p {
  margin-top: 6px;
  color: #65728a;
  font-size: 13px;
  line-height: 1.5;
}

textarea {
  display: block;
  width: 100%;
  min-height: 360px;
  resize: vertical;
  border: 0;
  padding: 16px;
  color: #172033;
  background: #fbfcff;
  font:
    14px / 1.7
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    monospace;
}

.article {
  min-height: 360px;
  padding: 18px;
  color: #25314a;
  font-size: 16px;
  line-height: 1.78;
}

.article p + p {
  margin-top: 14px;
}

mark {
  color: #111827;
  background-color: #fde68a;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgb(217 119 6 / 0.16);
}

@supports selector(::highlight(search-hit-demo)) {
  ::highlight(search-hit-demo) {
    color: #111827;
    background-color: #fde68a;
    text-decoration: underline solid rgb(217 119 6 / 0.55) 1px;
  }
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(54px, auto));
  gap: 8px;
  margin: 0;
}

.stats div {
  min-width: 58px;
  padding: 7px 8px;
  border: 1px solid #d9e1f2;
  border-radius: 6px;
  background: #f8fafc;
  text-align: center;
}

.stats dt {
  color: #65728a;
  font-size: 11px;
  line-height: 1.1;
}

.stats dd {
  margin: 3px 0 0;
  color: #172033;
  font-size: 17px;
  font-weight: 760;
  line-height: 1.1;
}

@media (max-width: 820px) {
  .app {
    padding: 12px;
  }

  .toolbar,
  .panel {
    grid-template-columns: 1fr;
  }

  .panel-heading--inline {
    display: grid;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
