:root {
  --ink: #18202a;
  --muted: #667085;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #d9dee7;
  --teal: #087b83;
  --teal-soft: #e8f5f6;
  --orange: #f28c28;
  --rose: #b5465b;
  --shadow: 0 18px 46px rgba(24, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(8, 123, 131, 0.14), transparent 36%),
    linear-gradient(315deg, rgba(242, 140, 40, 0.18), transparent 34%),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 32px 0;
}

.workspace {
  display: grid;
  gap: 24px;
}

.intro {
  display: flex;
  gap: 18px;
  align-items: center;
}

.mark {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mark svg {
  width: 52px;
  height: 52px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.counter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.08);
}

.stat.primary {
  border-color: rgba(8, 123, 131, 0.45);
  background: var(--teal-soft);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.editor-wrap {
  position: relative;
  display: grid;
  gap: 10px;
}

.editor-wrap label {
  color: var(--ink);
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  padding: 22px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  line-height: 1.7;
  outline: none;
}

textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(8, 123, 131, 0.16), var(--shadow);
}

textarea::placeholder {
  color: #98a1ae;
}

.toolbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button,
.text-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(24, 32, 42, 0.08);
}

.icon-button {
  width: 42px;
  display: grid;
  place-items: center;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.text-button {
  padding: 0 14px;
  font-weight: 800;
}

.icon-button:hover,
.text-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.icon-button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid rgba(242, 140, 40, 0.45);
  outline-offset: 2px;
}

.status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 24px, 680px);
    align-items: start;
    padding-top: 24px;
  }

  .intro {
    align-items: flex-start;
  }

  .mark {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }

  .mark svg {
    width: 42px;
    height: 42px;
  }

  .counter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  textarea {
    min-height: 330px;
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .intro {
    display: grid;
  }

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

  .stat {
    min-height: 88px;
  }

  .toolbar {
    position: static;
    justify-content: flex-end;
    margin-top: -2px;
  }
}
