:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --blue: #2563eb;
  --green: #15803d;
  --red: #b91c1c;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #ffffff;
  font-size: 15px;
  line-height: 1.6;
}

button,
textarea,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

/* Header */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.top-nav a {
  color: #4b5563;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.top-nav a:hover {
  color: #111827;
}

/* Product introduction */

.page-intro {
  padding: 52px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.page-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.intro-copy {
  max-width: 760px;
  margin: 16px 0 18px;
  color: #4b5563;
  font-size: 17px;
  line-height: 1.7;
}

.trust-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: #4b5563;
  font-size: 13px;
}

.trust-points i {
  margin-right: 5px;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

/* Main converter */

.tool-section {
  padding-bottom: 28px;
}

.converter {
  width: 100%;
  padding: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(17, 24, 39, 0.035);
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.panel-header {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-header label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

textarea {
  display: block;
  width: 100%;
  height: 360px;
  min-height: 300px;
  padding: 14px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  outline: none;
  background: #f9fafb;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  tab-size: 2;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:focus {
  border-color: #60a5fa;
  outline: 2px solid #bfdbfe;
  outline-offset: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

textarea::placeholder {
  color: #9ca3af;
}

textarea[readonly] {
  background: #f9fafb;
}

textarea[readonly]:focus {
  outline-color: #dbeafe;
}

/* Buttons */

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    opacity 0.15s;
}

.button-primary {
  color: #ffffff;
  background: #111827;
  border-color: #111827;
}

.button-primary:hover:not(:disabled) {
  background: #293548;
  border-color: #293548;
}

.button-secondary {
  color: #111827;
  background: #ffffff;
  border-color: #d1d5db;
}

.button-secondary:hover:not(:disabled) {
  background: #f3f4f6;
}

.button-quiet {
  color: #4b5563;
  background: transparent;
  border-color: var(--line);
}

.button-quiet:hover:not(:disabled) {
  background: #f3f4f6;
}

.text-button {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

/* Convert action and status */

.convert-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.primary-button {
  min-height: 44px;
  padding: 10px 24px;
  font-size: 14px;
}

.status-message {
  min-height: 22px;
  color: #6b7280;
  font-size: 12px;
}

.status-message.success {
  color: #15803d;
}

.status-message.error {
  color: #b91c1c;
}

.statistics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 24px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #9ca3af;
  font-size: 12px;
}

.statistics strong {
  color: #4b5563;
  font-weight: 650;
}

/* Privacy */

.privacy-note {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 0;
  padding: 15px 17px;
  background: #f0fdf4;
  border: 1px solid #dcfce7;
  border-radius: 11px;
}

.privacy-icon {
  flex: 0 0 auto;
  color: #15803d;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
}

.privacy-note p {
  margin: 0;
  color: #365744;
  font-size: 13px;
  line-height: 1.8;
}

.privacy-note strong {
  color: #14532d;
}

/* Instructions */

.content-section {
  padding: 16px 0 60px;
  border-top: 1px solid var(--line);
}

.info-section {
  width: 100%;
  max-width: none;
  margin: 0;
}

.info-section h2,
.faq-section h2 {
  margin: 30px 0 12px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.info-section h2:first-child {
  margin-top: 10px;
}

.info-section h3 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-size: 16px;
}

.info-section p,
.info-section li {
  color: #4b5563;
  font-size: 14px;
}

.info-section p {
  max-width: 1000px;
  margin: 0 0 14px;
  line-height: 1.8;
}

.info-section ul,
.info-section ol {
  padding-left: 23px;
  line-height: 1.8;
}

.info-section li {
  margin: 5px 0;
}

/* FAQ */

.faq-section {
  width: min(920px, 100%);
  margin: 38px 0 0;
}

.faq-section h2 {
  margin: 0 0 14px;
}

.faq-list {
  width: 100%;
  margin: 0;
}

.faq-item {
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.faq-item:first-child {
  border-top: 1px solid var(--line);
}

.faq-item summary {
  cursor: pointer;
  color: #111827;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.6;
}

.faq-item summary:hover {
  color: #2563eb;
}

.faq-item summary::marker {
  color: #6b7280;
}

.faq-item p {
  margin: 9px 0 2px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.8;
}

/* Footer */

.site-footer {
  padding: 24px 0;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  color: #9ca3af;
  font-size: 12px;
}

.footer-inner nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.site-footer a {
  color: #4b5563;
  font-size: 12px;
  text-decoration: none;
}

.site-footer a:hover {
  color: #111827;
}

/* Tablet */

@media (max-width: 800px) {
  .header-inner {
    min-height: 66px;
  }

  .page-intro {
    padding-top: 40px;
  }

  .intro-copy {
    font-size: 15px;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  textarea {
    height: 320px;
  }

  .content-section {
    padding-bottom: 45px;
  }
}

/* Mobile */

@media (max-width: 640px) {
  .container,
  .header-inner {
    width: calc(100% - 28px);
  }

  .header-inner {
    min-height: 62px;
    gap: 12px;
  }

  .brand-logo {
    width: 155px;
  }

  .top-nav {
    gap: 13px;
  }

  .top-nav a {
    font-size: 12px;
  }

  .page-intro {
    padding: 34px 0 22px;
  }

  .page-intro h1 {
    font-size: 34px;
  }

  .intro-copy {
    margin: 12px 0 15px;
    font-size: 14px;
  }

  .trust-points {
    gap: 7px 14px;
    font-size: 12px;
  }

  .tool-section {
    padding-bottom: 24px;
  }

  .converter {
    padding: 14px;
    border-radius: 12px;
  }

  .editor-grid {
    gap: 14px;
  }

  .editor-panel {
    padding: 12px;
  }

  .panel-header {
    align-items: flex-start;
    gap: 8px;
  }

  .panel-actions {
    gap: 5px;
  }

  .text-button {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 11px;
  }

  textarea {
    height: 260px;
    min-height: 210px;
    padding: 11px;
    font-size: 12px;
  }

  .convert-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
  }

  .primary-button {
    width: 100%;
  }

  .status-message {
    text-align: left;
  }

  .statistics {
    gap: 8px 15px;
  }

  .privacy-note {
    padding: 13px;
  }

  .content-section {
    padding: 15px 0 42px;
  }

  .info-section h2,
  .faq-section h2 {
    font-size: 19px;
  }

  .info-section h2:first-child {
    margin-top: 12px;
  }

  .faq-section {
    margin-top: 30px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .footer-inner nav {
    gap: 10px 16px;
  }
}

@media (max-width: 380px) {
  .brand-logo {
    width: 135px;
  }

  .top-nav {
    gap: 9px;
  }

  .top-nav a {
    font-size: 11px;
  }

  .page-intro h1 {
    font-size: 30px;
  }
}
