/* Globetta — сайт. Светлая и тёмная тема по системной настройке. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #15181d;
  --muted: #5b6470;
  --line: #e2e5ea;
  --accent: #1d6fe0;
  --accent-ink: #ffffff;
  --ph-bg: #fff1b8;
  --ph-text: #5a4300;
  --globe-hi: #8cc4ff;
  --globe-lo: #2a74d6;
  --land: #e9f3e4;
  --grid: rgba(255, 255, 255, 0.45);
  --pin: #ff6b4a;
  --pin-ring: #ffffff;
  --radius: 14px;
  --wrap: 1040px;
  --read: 72ch;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #171b21;
    --text: #e8ebef;
    --muted: #9aa3ae;
    --line: #262c34;
    --accent: #5aa2ff;
    --accent-ink: #0b1220;
    --ph-bg: #4a3b05;
    --ph-text: #ffe7a3;
    --globe-hi: #3f7fd0;
    --globe-lo: #12305c;
    --land: #5d8a5a;
    --grid: rgba(255, 255, 255, 0.22);
    --pin: #ff8a6e;
    --pin-ring: #0f1216;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
/* Японский: шрифты с иероглифами в запасе (Windows, Android), строка свободнее, без сжатия заголовков */
html:lang(ja) body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans CJK JP", sans-serif;
  line-height: 1.8;
  line-break: strict;
}
html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3 { letter-spacing: 0; line-height: 1.4; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 0 0 0.5em; }
h2 { font-size: 1.35rem; margin: 2em 0 0.6em; }
h3 { font-size: 1.05rem; margin: 1.4em 0 0.4em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Шапка */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-in {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 20px; padding-top: 12px; padding-bottom: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 650; font-size: 1.05rem;
}
.logo { width: 28px; height: 28px; color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; flex-basis: 100%; order: 3; font-size: 0.95rem; }
.nav a, .lang a { color: var(--muted); text-decoration: none; }
.nav a:hover, .lang a:hover { color: var(--text); }
.nav a[aria-current] { color: var(--text); font-weight: 600; }
.lang { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px; font-size: 0.85rem; }
.lang a { padding: 4px 8px; border-radius: 8px; font-weight: 600; }
.lang a[aria-current] { background: var(--bg); color: var(--text); }
@media (min-width: 760px) {
  .nav { flex-basis: auto; order: 2; margin-left: auto; }
  .lang { margin-left: 0; order: 3; }
}

/* Главная */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero-in {
  display: grid; gap: 24px; align-items: center;
  padding-top: 40px; padding-bottom: 48px;
}
@media (min-width: 760px) {
  .hero-in { grid-template-columns: 1.3fr 1fr; padding-top: 72px; padding-bottom: 80px; }
}
.kicker { margin: 0 0 8px; color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.globe { max-width: 320px; width: 70%; margin: 0 auto; }
.globe svg { display: block; width: 100%; height: auto; }
.cta { margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  text-decoration: none; font-weight: 600;
}
.btn .apple { width: 22px; height: 22px; }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.note { margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; }
.block { padding-top: 8px; padding-bottom: 8px; }
.cards {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.cards h3 { margin: 0 0 6px; }
.cards p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 22px 8px; margin: 1.5em 0;
}
.panel h2 { margin-top: 0.9em; }
.checks { padding-left: 1.2em; }
.checks li { margin: 0.3em 0; }

/* Документы и поддержка */
.doc { max-width: calc(var(--read) + 32px); padding-top: 36px; padding-bottom: 56px; }
.doc p, .doc li { max-width: var(--read); }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin: 0.35em 0; }
.legal h2 { scroll-margin-top: 16px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px; margin: 1.2em 0 0.5em; }
.toc summary { cursor: pointer; font-weight: 600; }
.toc ol { margin: 0.6em 0 0.2em; font-size: 0.95rem; }
.notice {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 10px 14px; color: var(--muted); font-size: 0.95rem;
}
.notice strong { color: var(--text); font-weight: 600; }
.table { overflow-x: auto; margin: 1em 0; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; background: var(--surface); }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); min-width: 9em; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; background: var(--bg); }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.faq details p { margin: 0 0 14px; color: var(--muted); }
.steps li { margin: 0.5em 0; }

/* Карточка из ссылки (/i/): собирается скриптом страницы из «#d=…» */
.share { text-align: center; }
.share [hidden] { display: none; }
.share .lead, .share .note, .share .notice { margin-left: auto; margin-right: auto; }
.share-card { padding: 22px 22px 18px; }
.share-card h1 { margin: 6px 0 2px; }
.share-card h2 { font-size: 0.9rem; margin: 1.6em 0 0.5em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.share-card p { margin: 0.3em auto; }
.share-emoji { font-size: 48px; line-height: 1.2; }
.share-level { color: #c8a24b; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.9rem; }
.share-stats { font-weight: 600; }
.muted { color: var(--muted); }
.flags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 0.95rem; }
.flags .flag { font-size: 1.4rem; margin-right: 5px; vertical-align: -2px; }
.share .checks { display: inline-block; text-align: left; margin: 0 auto; }
.share-list { list-style: none; padding: 0; margin: 0; text-align: left; }
.share-list li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.share-list li:first-child { border-top: 0; }
.share-list .emoji { font-size: 1.5rem; width: 32px; flex: none; text-align: center; }
.share-list p { margin: 2px 0 0; font-size: 0.95rem; }
/* Текст в карточке чужой: длинное слово без пробелов не должно раздвигать страницу */
.share-card, .share-list li > div { min-width: 0; overflow-wrap: anywhere; }
.share-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 1.5em 0; }
.btn-alt { background: var(--surface); color: var(--text); border: 1px solid var(--line); }

/* Незаполненное владельцем — видно сразу */
.ph { background: var(--ph-bg); color: var(--ph-text); border-radius: 4px; padding: 0 3px; }

/* Подвал */
.foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.88rem; }
.foot .wrap { padding-top: 22px; padding-bottom: max(26px, env(safe-area-inset-bottom)); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.foot nav a { color: var(--muted); }
.foot p { margin: 0; }

@media print {
  .top, .foot, .toc, .skip { display: none; }
  body { background: #fff; color: #000; }
}

/* Сравнение приложений (страницы «Переезд из …»): на узком экране строка таблицы — карточка, ячейки подписаны именем приложения */
@media (max-width: 640px) {
  .cmp thead { display: none; }
  .cmp, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; min-width: 0; }
  .cmp tr { padding: 6px 0; border-bottom: 1px solid var(--line); }
  .cmp tr:last-child { border-bottom: 0; }
  .cmp th, .cmp td { padding: 4px 12px; border-bottom: 0; background: none; }
  .cmp td::before { content: attr(data-app); display: block; font-weight: 600; font-size: 0.8rem; color: var(--muted); }
}

/* Подарок на /i/ (docs/подарки-план.md): открытка-печать и билет-сюрприз — пунктир как у талона, «бумага» — тёплый тон */
.gift-card { border-style: dashed; }
.gift-card h1 { font-size: 1.6rem; }
.gift-style-1 { background: color-mix(in srgb, #c8a24b 10%, var(--surface)); }
.gift-ticket { color: #c8a24b; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; }
.gift-lock { display: inline-block; padding: 8px 16px; border-radius: 999px; background: var(--line); font-weight: 600; }
.gift-from { font-weight: 600; margin-top: 0.8em !important; }
