:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #64708a;
  --line: #dfe5f0;
  --primary: #1467ff;
  --primary-dark: #0f4fc2;
  --accent: #ffcc3f;
  --success: #11845b;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(20, 103, 255, 0.08), transparent 38%),
    var(--bg);
  color: var(--ink);
}

.app {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  padding: 28px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(38, 56, 91, 0.08);
}

.form-panel,
.result-panel {
  padding: 24px;
}

.brand,
.result-header {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.brand {
  justify-content: flex-start;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--ink);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.45rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  line-height: 1.2;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 8px;
  color: #2a354c;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fbfcff;
  font: inherit;
  line-height: 1.45;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(20, 103, 255, 0.12);
}

textarea {
  resize: vertical;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  margin-top: 12px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.secondary {
  margin: 0;
  flex: 0 0 auto;
  background: #edf3ff;
  color: var(--primary-dark);
}

.secondary:hover {
  background: #dbe8ff;
}

#result {
  min-height: calc(100vh - 184px);
  white-space: pre-wrap;
}

.copy-status {
  min-height: 24px;
  margin-top: 10px;
  color: var(--success);
  font-weight: 700;
}

@media (max-width: 840px) {
  .app {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 680px);
    padding: 12px 0;
  }

  .form-panel,
  .result-panel {
    padding: 18px;
  }

  .result-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .secondary {
    width: 100%;
  }

  #result {
    min-height: 420px;
  }
}
