:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --paper: #fffdfa;
  --paper-soft: #fbf7ef;
  --text: #1f2328;
  --heading: #111827;
  --muted: #6f6a61;
  --line: #ded6ca;
  --line-strong: #cfc4b5;
  --accent: #0f766e;
  --accent-soft: #e8f4f1;
  --gold: #a86712;
  --gold-soft: #fbf0dc;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --shadow: 0 24px 70px rgba(44, 35, 24, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(244, 241, 235, 0.98)),
    repeating-linear-gradient(
      90deg,
      rgba(31, 35, 40, 0.035) 0,
      rgba(31, 35, 40, 0.035) 1px,
      transparent 1px,
      transparent 88px
    );
  color: var(--text);
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

main {
  width: min(1040px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 26px 0 64px;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

nav a:hover {
  background: rgba(255, 253, 250, 0.72);
  color: var(--heading);
  text-decoration: none;
}

nav a:first-child {
  margin-right: auto;
  padding-left: 0;
  color: var(--heading);
  font-size: 15px;
  font-weight: 900;
}

nav a:first-child::before {
  content: "";
  width: 28px;
  height: 28px;
  margin-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.94), rgba(168, 103, 18, 0.92)),
    var(--accent);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(26px, 5vw, 58px);
}

.legal-doc {
  max-width: 980px;
  margin: 0 auto;
}

.doc::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.doc-head h1 {
  margin-bottom: 14px;
}

.lang-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch a:hover {
  color: var(--heading);
  text-decoration: none;
}

.lang-switch a.active {
  background: #ffffff;
  color: var(--heading);
  box-shadow: 0 8px 18px rgba(44, 35, 24, 0.08);
}

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

h1 {
  max-width: 780px;
  color: var(--heading);
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  margin-bottom: 14px;
  font-weight: 900;
}

h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  font-size: clamp(20px, 2.5vw, 25px);
  line-height: 1.25;
  margin: 34px 0 12px;
  font-weight: 800;
}

h2::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
}

h3 {
  color: var(--heading);
  font-size: 17px;
  margin: 22px 0 8px;
  font-weight: 800;
}

p {
  margin-bottom: 16px;
}

.muted,
.updated {
  color: var(--muted);
}

.updated {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  margin-bottom: 22px;
  font-size: 13px;
  font-weight: 700;
}

h1 + .updated + p {
  max-width: 780px;
  color: #3d3b36;
  font-size: 17px;
  line-height: 1.78;
  margin-bottom: 24px;
}

.lead {
  max-width: 860px;
  color: #3d3b36;
  font-size: 17px;
  line-height: 1.82;
  margin-bottom: 24px;
}

.notice {
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-left: 5px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 16px;
  border-radius: 8px;
  margin: 20px 0 22px;
  color: #164e48;
  font-weight: 700;
}

.summary-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(251, 247, 239, 0.96)),
    var(--paper-soft);
  padding: 18px 20px;
  margin: 24px 0 30px;
}

.summary-panel h2 {
  margin-top: 0;
}

.compact-list {
  columns: 2;
  column-gap: 28px;
}

.danger {
  display: inline-block;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 8px 10px;
  font-weight: 800;
}

.doc ul:not(.legal-grid),
.doc ol {
  padding-left: 0;
}

.doc ul:not(.legal-grid) {
  list-style: none;
}

.doc ul:not(.legal-grid) li {
  position: relative;
  padding-left: 22px;
  margin: 8px 0;
}

.doc ul:not(.legal-grid) li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.76em;
  width: 7px;
  height: 7px;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.doc ol {
  margin-left: 20px;
}

.doc ol li {
  padding-left: 4px;
  margin: 8px 0;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
}

.legal-grid li {
  margin: 0;
}

.legal-grid a {
  display: block;
  height: 100%;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--paper-soft));
  padding: 18px;
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.legal-grid a:hover {
  border-color: rgba(15, 118, 110, 0.34);
  box-shadow: 0 16px 36px rgba(44, 35, 24, 0.1);
  transform: translateY(-1px);
}

.legal-grid strong {
  display: block;
  color: var(--heading);
  font-size: 17px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.legal-grid span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 560;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 16px 0 24px;
  background: #ffffff;
  font-size: 14px;
  max-width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 13px 14px;
  vertical-align: top;
  text-align: left;
}

tr:last-child td {
  border-bottom: 0;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  background: var(--gold-soft);
  color: #4d3514;
  font-size: 13px;
  font-weight: 800;
}

td {
  color: #34312d;
}

th,
td,
p,
li {
  overflow-wrap: anywhere;
}

footer {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

::selection {
  background: rgba(15, 118, 110, 0.18);
}

@media (max-width: 760px) {
  main {
    width: min(100vw - 22px, 1040px);
    padding: 14px 0 38px;
  }

  nav {
    gap: 2px;
    margin-bottom: 14px;
  }

  nav a:first-child {
    flex-basis: 100%;
    margin-bottom: 4px;
  }

  .doc {
    padding: 26px 20px;
  }

  .doc-head {
    display: block;
  }

  .lang-switch {
    width: 100%;
    margin: 2px 0 18px;
  }

  .lang-switch a {
    flex: 1;
    justify-content: center;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    margin-top: 30px;
  }

  .lead {
    font-size: 16px;
    line-height: 1.76;
  }

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

  .compact-list {
    columns: 1;
  }

  table {
    display: block;
    overflow-x: auto;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    min-width: 180px;
    padding: 12px;
  }
}

@media (max-width: 420px) {
  main {
    width: min(100vw - 16px, 1040px);
    padding-top: 10px;
  }

  nav a {
    min-height: 34px;
    padding: 0 8px;
    font-size: 13px;
  }

  nav a:first-child::before {
    width: 24px;
    height: 24px;
    margin-right: 8px;
  }

  .doc {
    padding: 24px 16px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 20px;
  }
}
