:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --text: #1c1c1c;
  --muted: #4a4a4a;
  --line: #d8d2c6;
  --accent: #1e4d8c;
  --accent-hover: #163a6b;
  --today: #2e6b3a;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 20px;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a {
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.langs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.lang {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}

.lang:hover,
.lang:focus-visible {
  border-color: var(--accent);
  outline: 3px solid #c5d4ef;
}

.lang.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -16px 20px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.back,
.to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  font-weight: 700;
}

.back:hover,
.back:focus-visible,
.to-top:hover,
.to-top:focus-visible {
  border-color: var(--accent);
  outline: 3px solid #c5d4ef;
}

.to-top {
  color: var(--muted);
}

.header .title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title {
  margin: 0;
  font-size: 1.6rem;
}

.lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.05rem;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 16px 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}

.btn:hover,
.btn:focus-visible {
  outline: 3px solid #c5d4ef;
}

.btn-main {
  background: var(--accent);
  color: #fff;
}

.btn-main:hover,
.btn-main:focus-visible {
  background: var(--accent-hover);
  outline-color: #8fb0e0;
}

.btn.today {
  outline: 3px solid var(--today);
}

.btn .hint {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.85;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.step {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.step-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 16px 12px;
}

.num {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.step p {
  margin: 0;
  font-size: 1.1rem;
}

.step img,
.placeholder {
  display: block;
  width: 100%;
  height: auto;
  background: #ece7dc;
}

.placeholder {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.empty {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 20px;
  box-shadow: var(--shadow);
}

.hidden {
  display: none;
}
