:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --paper: #ffffff;
  --ink: #17202a;
  --muted: #647282;
  --line: #dce3ea;
  --blue: #2563eb;
  --green: #057a63;
  --soft: #eef8f5;
  --soft-blue: #eef4ff;
  --shadow: 0 18px 42px rgba(21, 31, 45, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.site-header, main, footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 16px;
}

.brand {
  font-weight: 800;
  font-size: 1rem;
}

nav {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.78fr);
  gap: 18px;
  align-items: stretch;
  padding: 10px 0 24px;
}

.tool-panel, .result-panel, article, .plain-section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-panel { padding: clamp(22px, 3vw, 32px); }

.panel-head {
  max-width: 720px;
  margin-bottom: 24px;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  font-size: clamp(2rem, 4.2vw, 3.85rem);
  line-height: 1.06;
  margin-bottom: 12px;
  letter-spacing: 0;
}

.panel-head p, .plain-section p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.62;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: #31424e;
  font-size: 0.82rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfdae3;
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfe;
  font: inherit;
  font-size: 0.96rem;
}

input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.14);
  border-color: var(--blue);
}

.result-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 0;
}

.results {
  display: grid;
  gap: 10px;
  margin: 0;
}

.results div {
  padding: 15px;
  border-radius: 8px;
  background: var(--soft-blue);
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

dd {
  margin: 5px 0 0;
  color: var(--green);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 900;
  line-height: 1.1;
}

.summary {
  min-height: 48px;
  margin: 0;
  color: #31424e;
  line-height: 1.55;
  font-weight: 700;
}

.ad-slot {
  margin-top: auto;
  min-height: 88px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8c4cf;
  border-radius: 8px;
  background: #fafbfd;
  color: #778492;
  font-weight: 800;
  font-size: 0.9rem;
}

.content, .plain-section {
  margin: 24px 0;
}

.language-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 26px;
}

.lang {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 0.84rem;
  font-weight: 800;
}

.lang.active {
  border-color: rgba(4, 120, 87, 0.35);
  background: var(--soft);
  color: var(--green);
}

.content > h2 {
  margin: 0 0 16px;
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

article {
  padding: 18px;
  box-shadow: none;
}

article h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

article p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.94rem;
  margin-bottom: 0;
}

.read-more {
  display: inline-flex;
  margin-top: 14px;
  color: var(--green);
  font-weight: 900;
}

.plain-section {
  padding: 24px;
  box-shadow: none;
}

.legal-page {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 38px;
  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--ink);
  font-weight: 900;
}

[dir="rtl"] .site-header,
[dir="rtl"] footer {
  direction: rtl;
}

@media (max-width: 900px) {
  .site-header, footer { align-items: flex-start; flex-direction: column; }
  nav { flex-wrap: wrap; }
  .hero { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 22px, 1180px); }
  .tool-panel, .result-panel { padding: 20px; }
  .grid-form, .article-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2.12rem; }
  nav { gap: 10px; font-size: 0.86rem; }
  .results div { padding: 13px; }
}
