/* Verbos Españoles — оформление сайта.
   Палитра взята из приложения: зелёный Material (#4CAF50) на серых
   поверхностях, светлая и тёмная темы. */

:root {
  --green: #4CAF50;
  --green-dk: #388E3C;
  --green-lt: #e8f5e9;

  --bg: #ffffff;
  --bg-alt: #f4f6f4;
  --card: #ffffff;
  --fg: #1b1f1b;
  --muted: #5c665c;
  --line: #e2e6e2;
  --link: #2e7d32;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .04);

  --wrap: 1080px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #66bb6a;
    --green-dk: #81c784;
    --green-lt: #1f2a20;

    --bg: #15181a;
    --bg-alt: #1c2022;
    --card: #202527;
    --fg: #e6e9e6;
    --muted: #9fa8a0;
    --line: #2d3336;
    --link: #8bd68f;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --green: #66bb6a;
  --green-dk: #81c784;
  --green-lt: #1f2a20;

  --bg: #15181a;
  --bg-alt: #1c2022;
  --card: #202527;
  --fg: #e6e9e6;
  --muted: #9fa8a0;
  --line: #2d3336;
  --link: #8bd68f;
  --shadow: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-dk); }

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(28px, 4.4vw, 40px); margin: 0 0 14px; }
h2 { font-size: clamp(21px, 2.6vw, 27px); margin: 44px 0 12px; }
h3 { font-size: 17px; margin: 0 0 8px; }

p { margin: 0 0 14px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 720px; }
@media (min-width: 700px) { .wrap { padding: 0 24px; } }

.sr, .skip {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  width: auto; height: auto; clip: auto;
  padding: 10px 16px; background: var(--green); color: #fff; border-radius: 8px;
}

/* ───────────────────────────── шапка ───────────────────────────── */

.head {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.head-row { display: flex; align-items: center; gap: 14px; min-height: 60px; }

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 17px; color: var(--fg); text-decoration: none;
  white-space: nowrap;
}
.brand img { border-radius: 7px; }

.nav { display: flex; gap: 18px; margin-left: 10px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--fg); }

.head-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.langs { display: flex; gap: 2px; }
.langs a {
  padding: 3px 7px; border-radius: 6px; font-size: 12px; font-weight: 600;
  color: var(--muted); text-decoration: none; letter-spacing: .03em;
}
.langs a:hover { background: var(--bg-alt); color: var(--fg); }
.langs a[aria-current] { background: var(--green-lt); color: var(--green-dk); }

.theme-toggle {
  width: 30px; height: 30px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-alt) center / 16px no-repeat;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%235c665c" stroke-width="2"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5L19 19M19 5l-1.5 1.5M6.5 17.5L5 19"/></svg>');
}
:root[data-theme="dark"] .theme-toggle,
:root:not([data-theme="light"]) .theme-toggle {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%239fa8a0" stroke-width="2"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>');
}

.head-cta { padding: 7px 14px; font-size: 14px; white-space: nowrap; }
.cta-short { display: none; }

/* Текстовое меню на телефоне прячется — кнопка остаётся. Ради неё шапка
   по очереди отдаёт: длинную подпись кнопки, потом название сайта.
   Исчезает всё, кроме знака, языков и самой кнопки. */
@media (max-width: 760px) {
  .nav { display: none; }
}
@media (max-width: 620px) {
  .cta-long { display: none; }
  .cta-short { display: inline; }
}
@media (max-width: 430px) {
  .brand span { display: none; }
  .head-row { gap: 10px; }
  .head-right { gap: 8px; }
  .head-cta { padding: 7px 11px; }
}

/* ───────────────────────────── поиск ───────────────────────────── */

.search-row { padding: 12px 16px 14px; }
@media (min-width: 700px) { .search-row { padding: 12px 24px 14px; } }

.search { position: relative; max-width: 560px; }

#q {
  width: 100%; padding: 11px 14px;
  font: inherit; font-size: 16px; color: var(--fg);
  background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 10px;
}
#q:focus { outline: 2px solid var(--green); outline-offset: 1px; background: var(--bg); }

.search-hint { margin: 7px 0 0; font-size: 13px; color: var(--muted); }

.results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 60vh; overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
}
.results a, .results p {
  display: block; margin: 0; padding: 9px 14px;
  text-decoration: none; color: var(--fg); font-size: 15px;
  border-bottom: 1px solid var(--line);
}
.results a:last-child, .results p:last-child { border-bottom: 0; }
.results a:hover, .results a[aria-selected="true"] { background: var(--green-lt); }
.results b { color: var(--green-dk); }
.results small { color: var(--muted); font-size: 13px; }
.results p { color: var(--muted); font-size: 14px; }

/* ───────────────────────── общие элементы ──────────────────────── */

main { padding: 24px 0 56px; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 42em; }
.lead-sm { font-size: 17px; color: var(--muted); max-width: 46em; }
.small { font-size: 14px; color: var(--muted); }
.sub { font-size: 16px; color: var(--muted); margin: -4px 0 20px; }
.updated { font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.note {
  padding: 10px 14px; margin: 0 0 18px;
  background: var(--bg-alt); border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0; font-size: 15px; color: var(--muted);
}

.hero { padding: 26px 0 8px; }

.btn {
  display: inline-block; padding: 11px 20px;
  background: var(--green); color: #fff; font-weight: 600; font-size: 16px;
  border: 1px solid transparent; border-radius: 9px; text-decoration: none;
}
.btn:hover { background: var(--green-dk); color: #fff; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-alt); color: var(--fg); }

.cta-row { display: flex; flex-wrap: wrap; gap: 11px; margin: 20px 0; }

.band {
  margin: 44px 0; padding: 26px;
  background: var(--bg-alt); border-radius: var(--radius);
}
.band h2 { margin-top: 0; }
.band p { max-width: 44em; }

.cta { margin: 48px 0 0; padding: 26px; background: var(--green-lt);
       border-radius: var(--radius); }
.cta h2 { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.chip {
  padding: 5px 12px; font-size: 15px; text-decoration: none;
  color: var(--link); background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 999px;
}
.chip:hover { background: var(--green-lt); border-color: var(--green); }

.cards {
  display: grid; gap: 16px; padding: 0; margin: 20px 0; list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  padding: 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.cards.numbered { counter-reset: c; }
.cards.numbered .card h3::before {
  counter-increment: c; content: counter(c) ". "; color: var(--green);
}

.meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 24px; }
.meta div { display: flex; gap: 8px; align-items: baseline; }
.meta dt { font-size: 13px; color: var(--muted); text-transform: uppercase;
           letter-spacing: .04em; margin: 0; }
.meta dd { margin: 0; font-weight: 600; }
.meta.wide { flex-direction: column; gap: 8px; }

.faq {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 16px; margin-bottom: 10px; background: var(--card);
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; color: var(--muted); }

/* ──────────────────────── таблицы спряжения ────────────────────── */

.mood {
  margin: 40px 0 4px; padding-bottom: 6px;
  border-bottom: 2px solid var(--green); font-size: 19px;
}

.tenses {
  display: grid; gap: 16px; margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.tense-card {
  padding: 16px 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.tense-card h3 { margin: 0 0 2px; font-size: 16px; }
.tense-card h3 a { text-decoration: none; }
.tense-card h3 a:hover { text-decoration: underline; }
.tense-card .alt { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.tense-card table { width: 100%; border-collapse: collapse; }
.tense-card th, .tense-card td { padding: 4px 0; text-align: left; font-size: 15px; }
.tense-card th {
  font-weight: 400; color: var(--muted); white-space: nowrap;
  padding-right: 12px; width: 44%;
}
.tense-card td { font-variant-numeric: tabular-nums; }
.tense-card tr + tr th, .tense-card tr + tr td { border-top: 1px solid var(--line); }

.scroll { overflow-x: auto; margin: 16px 0 24px; }
table.grid { border-collapse: collapse; font-size: 15px; min-width: 100%; }
table.grid th, table.grid td {
  padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.grid thead th { font-size: 13px; color: var(--muted); font-weight: 600; }
table.grid tbody th { font-weight: 600; }

/* ───────────────── объяснения времени: две вкладки ──────────────── */

.tabs { display: flex; gap: 6px; margin: 18px 0 16px; }
.tab {
  padding: 7px 15px; font: inherit; font-size: 15px; cursor: pointer;
  color: var(--muted); background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 999px;
}
.tab[aria-selected="true"] {
  background: var(--green-lt); color: var(--green-dk);
  border-color: var(--green); font-weight: 600;
}

.prose { max-width: 44em; }
.prose ul { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 5px; }
.prose ul ul { margin-top: 5px; }
.prose em { color: var(--muted); font-style: italic; }
.prose strong { color: var(--fg); }
.prose code {
  padding: 1px 5px; font-size: .9em; background: var(--bg-alt);
  border-radius: 5px;
}

/* ──────────────────────────── указатели ────────────────────────── */

.jump {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 8px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.jump a {
  min-width: 30px; padding: 4px 8px; text-align: center; font-weight: 600;
  font-size: 14px; text-decoration: none; color: var(--link);
  background: var(--bg-alt); border-radius: 7px;
}
.jump a:hover { background: var(--green-lt); }

.letter h2 { margin: 32px 0 10px; }
.verb-list {
  display: grid; gap: 2px 16px; padding: 0; margin: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
.verb-list a { text-decoration: none; font-size: 15px; }
.verb-list a:hover { text-decoration: underline; }

/* ──────────────────── промо приложения ─────────────────────────── */

/* Полоса скриншотов уезжает под края .wrap: иначе на телефоне у правого
   края видно ровно ничего и непонятно, что её можно листать. */
.shots {
  display: flex; gap: 16px; overflow-x: auto;
  margin: 0 -16px; padding: 4px 16px 14px;
  scroll-snap-type: x proximity;
}
@media (min-width: 700px) {
  .shots { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
}
.shot { flex: 0 0 auto; width: 190px; margin: 0; scroll-snap-align: start; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-alt);
}
.shot figcaption { margin-top: 9px; font-size: 13px; color: var(--muted); }

/* Таблица «бесплатно / платно». Сжимать её до телефона нечестно — цифры
   в соседних колонках должны стоять рядом, — поэтому она прокручивается
   вбок целиком. */
.table-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
@media (min-width: 700px) {
  .table-scroll { margin: 0; padding: 0; }
}
.tiers {
  width: 100%; min-width: 460px; border-collapse: collapse; font-size: 15px;
}
.tiers th, .tiers td {
  padding: 9px 12px 9px 0; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.tiers thead th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border-bottom: 2px solid var(--line);
}
.tiers thead th:last-child { color: var(--green-dk); }
.tiers tbody th { font-weight: 400; padding-right: 20px; }
.tiers td { color: var(--muted); white-space: nowrap; }
.tiers .yes { color: var(--green-dk); font-weight: 700; }
.tiers tbody tr:last-child th, .tiers tbody tr:last-child td { border-bottom: 0; }

/* Телефон: боковая прокрутка таблицы бессмысленна — видно одну колонку,
   а сравнивать надо две. Строка разворачивается в блок: признак сверху,
   под ним оба значения с подписями. */
@media (max-width: 679px) {
  .table-scroll { overflow: visible; margin: 0; padding: 0; }
  .tiers, .tiers tbody, .tiers tr, .tiers th, .tiers td {
    display: block; width: auto; min-width: 0;
  }
  .tiers thead { display: none; }
  .tiers tbody tr {
    padding: 13px 0; border-bottom: 1px solid var(--line);
  }
  .tiers tbody tr:last-child { border-bottom: 0; }
  .tiers tbody th {
    padding: 0 0 7px; border: 0; font-weight: 600; color: var(--fg);
  }
  .tiers tbody td {
    display: flex; gap: 10px; padding: 2px 0; border: 0;
    white-space: normal; font-size: 14px;
  }
  .tiers tbody td::before {
    content: attr(data-l); flex: 0 0 8.5em; color: var(--muted);
    /* .yes — жирный зелёный; подпись колонки жирнеть вместе с ним не должна. */
    font-weight: 400;
  }
}

.badge { display: inline-block; }
.badge img { display: block; height: 60px; width: auto; }

/* ───────────────────────────── подвал ──────────────────────────── */

.foot {
  border-top: 1px solid var(--line); padding: 26px 0 44px;
  color: var(--muted); font-size: 14px;
}
.foot-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.foot-pub {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg); text-decoration: none; font-size: 15px;
}
.foot-pub img { flex: 0 0 auto; }
.foot-logo { height: 28px; width: auto; border-radius: 3px; }
.foot-icon { height: 34px; width: 34px; border-radius: 7px; }
.foot-pub-name { font-weight: 600; }
.foot-pub-site { color: var(--muted); }
.foot-pub:hover .foot-pub-site { color: var(--green-dk); text-decoration: underline; }
.foot-pub-name::after { content: ' ·'; color: var(--line); font-weight: 400; }
.foot-data { margin: 0 0 8px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }
.foot-nav a { color: var(--muted); }
.foot-rights { margin: 0; font-size: 13px; }

/* Мгновенная навигация: пока грузится следующая страница. */
body.is-loading { cursor: progress; }
body.is-loading main { opacity: .55; transition: opacity .12s ease-out .08s; }
