* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f7f4;
  color: #1f2933;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.panel,
article,
.history {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  background: #fff;
}

.hidden {
  display: none;
}

.topbar,
.result-title,
.save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

h1 {
  margin: 0 0 14px;
  font-size: 22px;
}

h2 {
  margin: 0;
  font-size: 15px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0;
}

button {
  min-height: 42px;
  border: 1px solid #c8d0d8;
  border-radius: 8px;
  background: #fff;
  color: #1f2933;
  font-size: 15px;
}

.tab.active,
.primary {
  border-color: #176b87;
  background: #176b87;
  color: #fff;
}

.ghost {
  background: transparent;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span,
.save-row span {
  color: #52616b;
  font-size: 13px;
}

textarea,
input {
  width: 100%;
  padding: 11px;
  border: 1px solid #c8d0d8;
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
}

textarea {
  resize: vertical;
}

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

.primary {
  width: 100%;
  font-weight: 700;
}

.message {
  min-height: 20px;
  color: #8a4b0f;
  font-size: 14px;
}

pre {
  min-height: 24px;
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.55;
}

.history-item {
  padding: 10px 0;
  border-top: 1px solid #edf0f2;
  font-size: 14px;
}

.history-item strong,
.history-item span {
  display: block;
  margin-bottom: 4px;
}

.history-item span {
  color: #52616b;
  font-size: 12px;
}

@media (max-width: 420px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    gap: 6px;
  }
}
