:root {
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  color: #17202a;
  background: #f7f5ff;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 102, 76, 0.13), transparent 34rem),
    linear-gradient(180deg, #f9f8ff 0%, #f3f1fb 100%);
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 46rem);
  margin: 0 auto;
  padding: 1rem;
}

.app-card {
  padding: 1.25rem;
  border: 1px solid rgba(54, 40, 92, 0.1);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1.25rem 3.5rem rgba(55, 37, 101, 0.1);
}

.app-header {
  margin: 0.25rem 0 1.5rem;
}

h1 {
  margin: 0;
  color: #2d2350;
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.field {
  margin-top: 1.25rem;
}

label,
legend {
  display: block;
  margin-bottom: 0.5rem;
  color: #342b4c;
  font-size: 0.9rem;
  font-weight: 750;
}

textarea {
  width: 100%;
  border: 1px solid #d9d3e6;
  border-radius: 0.9rem;
  color: #1f1b2d;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea {
  min-height: 7rem;
  padding: 0.9rem 1rem;
  line-height: 1.6;
  resize: vertical;
}

#comment-text {
  min-height: 3.25rem;
  overflow: hidden;
}

textarea::placeholder {
  color: #9992a7;
}

textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: #7657dd;
  box-shadow: 0 0 0 4px rgba(118, 87, 221, 0.15);
}

.format-section {
  min-width: 0;
  padding: 0;
  border: 0;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.format-button {
  min-height: 3rem;
  padding: 0.6rem 0.35rem;
  border: 1px solid #d9d0f4;
  border-radius: 0.8rem;
  color: #594f6d;
  background: #f7f4ff;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
}

.format-button[aria-pressed="true"] {
  border-color: #7456d8;
  color: #fff;
  background: #7456d8;
  box-shadow: 0 0.35rem 0.9rem rgba(104, 72, 193, 0.18);
}

.button {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 0.9rem;
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

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

.button:hover {
  filter: brightness(0.97);
}

.button + .button {
  margin-top: 0.75rem;
}

.button-secondary {
  border: 1px solid #d9d0f4;
  color: #5940ad;
  background: #f2edff;
}

.swarm-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid #b8a6e8;
  color: #5940ad;
  background: #fff;
}

.swarm-open-button__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.app-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid #b8a6e8;
  color: #5940ad;
  background: #fff;
}

.app-share-button__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, #7456d8, #8b59c7);
  box-shadow: 0 0.6rem 1.4rem rgba(104, 72, 193, 0.2);
}

.button-x {
  min-height: 3.75rem;
  color: #fff;
  background: #101114;
  box-shadow: 0 0.65rem 1.4rem rgba(16, 17, 20, 0.2);
}

.result-field {
  margin-top: 1.35rem;
  padding: 1rem;
  border: 1px solid #e5dff0;
  border-radius: 1rem;
  background: #fbfaff;
}

#result-text {
  min-height: 8rem;
}

.character-count {
  margin: 0.45rem 0 0;
  color: #6f6879;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.character-count[data-tone="warning"] {
  color: #8a6415;
}

.character-count[data-tone="error"] {
  color: #a5332d;
  font-weight: 700;
}

.status {
  min-height: 1.25rem;
  margin: 0.45rem 0 0;
  color: #6b6474;
  font-size: 0.82rem;
  line-height: 1.5;
}

.paste-help {
  margin: 0.6rem 0 0;
  color: #6f6879;
  font-size: 0.82rem;
  line-height: 1.5;
}

.first-use-guide {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid #e2daf8;
  border-radius: 0.9rem;
  color: #514666;
  background: #f7f3ff;
  font-size: 0.84rem;
}

.first-use-guide ol {
  margin: 0;
  padding-left: 1.35rem;
  line-height: 1.65;
}

.result-field + .button,
.character-count + .button {
  margin-top: 1rem;
}

.status[data-tone="error"] {
  color: #a5332d;
}

.status[data-tone="success"] {
  color: #287052;
}

.footer {
  padding: 0.75rem 1rem 2rem;
  color: #746d80;
  font-size: 0.82rem;
  text-align: center;
}

.footer a {
  border-radius: 0.2rem;
  color: #5940ad;
  font-weight: 750;
  text-underline-offset: 0.2em;
}

noscript {
  display: block;
  padding: 1rem;
  color: #a5332d;
  text-align: center;
}

@media (min-width: 42rem) {
  .app-shell {
    padding: 2.5rem 1.5rem 1.25rem;
  }

  .app-card {
    padding: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
