:root {
  color-scheme: light;
  --bg: #f6f9fd;
  --surface: #ffffff;
  --surface-2: #eef6ff;
  --text: #18232f;
  --muted: #637283;
  --line: #d9e7f5;
  --primary: #2f7edb;
  --primary-2: #1f63b3;
  --primary-soft: #dcecff;
  --accent: #e17b21;
  --danger: #b83c3c;
  --shadow: 0 14px 36px rgba(47, 126, 219, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--primary);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner,
.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-label {
  font-size: 0.875rem;
  color: var(--muted);
}

select,
textarea,
button {
  font: inherit;
}

select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.ad-band {
  min-height: 92px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.875rem;
}

.hero {
  padding: 28px 0 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.lead {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.tool {
  display: grid;
  gap: 16px;
  padding: 0 0 30px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 1rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.875rem;
}

textarea {
  width: 100%;
  min-height: 310px;
  resize: vertical;
  display: block;
  border: 0;
  outline: 0;
  padding: 16px;
  color: var(--text);
  background: #fff;
  border-radius: 0 0 8px 8px;
}

textarea:focus {
  box-shadow: inset 0 0 0 2px rgba(47, 126, 219, 0.24);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  color: #fff;
  background: var(--button-bg, var(--primary));
  font-weight: 720;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 18px rgba(42, 67, 101, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover {
  background: var(--button-hover, var(--primary-2));
  box-shadow: 0 10px 22px rgba(42, 67, 101, 0.16);
  transform: translateY(-1px);
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(225, 123, 33, 0.35);
  outline-offset: 2px;
}

.button-secondary {
  --button-bg: #5e90bf;
  --button-hover: #4779a8;
}

.button-secondary:hover {
  background: var(--button-hover);
}

.button-accent {
  --button-bg: #f08b32;
  --button-hover: #d8731e;
}

.button-accent:hover {
  background: var(--button-hover);
}

.button-danger {
  --button-bg: #c94b5a;
  --button-hover: #a83c49;
}

.button-danger:hover {
  background: var(--button-hover);
}

button[data-tone="case"] {
  --button-bg: #2f7edb;
  --button-hover: #1f63b3;
}

button[data-tone="style"] {
  --button-bg: #6f73d9;
  --button-hover: #565bb8;
}

button[data-tone="separator"] {
  --button-bg: #18a0b8;
  --button-hover: #127f93;
}

button[data-tone="clean"] {
  --button-bg: #4f8f73;
  --button-hover: #3d745c;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 0 38px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.info-card h2,
.info-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.info-card p,
.info-card li {
  color: var(--muted);
}

.info-card ul {
  margin: 0;
  padding-inline-start: 20px;
}

.faq {
  padding: 8px 0 46px;
}

.faq h2 {
  margin: 0 0 16px;
}

details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

summary {
  cursor: pointer;
  font-weight: 760;
}

details p {
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 34px;
  color: var(--muted);
  background: #fff;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

[dir="rtl"] .brand,
[dir="rtl"] .header-actions,
[dir="rtl"] .panel-head,
[dir="rtl"] .footer-inner {
  flex-direction: row-reverse;
}

@media (max-width: 840px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .workspace,
  .info-grid {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 240px;
  }
}

@media (max-width: 520px) {
  .header-inner,
  .wrap {
    width: min(100% - 22px, 1120px);
  }

  h1 {
    font-size: 2rem;
  }

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

  button {
    padding: 0 10px;
    font-size: 0.92rem;
  }
}
