@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/montserrat-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/montserrat-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #111111;
  --paper: #ffffff;
  --grey: #8f8f8f;
  --grey-2: #555555;
  --line: #e6e6e6;
  --dark-grey: #a8a8a8;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + var(--safe-b));
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.muted { color: var(--grey); }
.small { font-size: 12px; }

/* top bar: always visible */
.bar {
  position: sticky; top: 0; z-index: 10;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + var(--safe-t)) 20px 12px;
}
.logo {
  text-decoration: none; border: 1.5px solid var(--paper);
  font-weight: 700; font-size: 12px; line-height: 1.05; padding: 4px 7px;
}
.logo small { display: block; font-weight: 400; font-size: 8px; letter-spacing: 0.2px; }
.count { font-size: 12px; color: var(--dark-grey); }
.burger { width: 26px; height: 20px; display: flex; flex-direction: column; justify-content: space-between; padding: 3px 0; }
.burger span { display: block; height: 2px; background: var(--paper); }

/* black hero block */
.hero { background: var(--ink); color: var(--paper); padding: 6px 20px 30px; }
.hero h1 { font-size: 27px; line-height: 1.18; letter-spacing: -0.4px; font-weight: 700; margin: 0; }
.hero .label { font-size: 12px; color: var(--dark-grey); margin-bottom: 8px; }
.hero .sub { font-size: 12px; color: var(--dark-grey); margin-top: 10px; line-height: 1.5; }
.dots { display: flex; gap: 7px; margin: 10px 0 18px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #4a4a4a; }
.dots i.on { background: var(--paper); }
.done-mark { display: inline-block; font-size: 11px; border: 1px solid var(--paper); padding: 1px 7px; margin-left: 8px; vertical-align: 3px; }

/* content */
.body { padding: 8px 20px 24px; }
.body h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin: 26px 0 8px; }
.body h3 { font-size: 16px; font-weight: 700; margin: 22px 0 6px; }
.body p { margin: 10px 0; }
.body ul, .body ol { padding-left: 20px; margin: 10px 0; }
.body li { margin: 5px 0; }
.body strong { font-weight: 600; }
.body em { font-style: italic; }
.body a { text-underline-offset: 3px; word-break: break-word; }
.body code { font-family: Consolas, monospace; font-size: 13px; background: #f2f2f2; padding: 1px 4px; }
.note { border: 1px solid var(--ink); padding: 4px 16px; margin: 18px 0 8px; }

.tw { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 0.5px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: 12px; color: var(--grey); }

/* words */
.words { margin: 4px 0 10px; }
.word {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  width: 100%; text-align: left; padding: 12px 0; border-bottom: 0.5px solid var(--line);
}
.word .en { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.word .rd { font-size: 11px; color: var(--grey); margin-top: 1px; }
.word .ru { font-size: 14px; color: var(--grey-2); text-align: right; }
.word.playing .en { text-decoration: underline; text-underline-offset: 4px; }
.speak-all { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; margin: 6px 0 0; }

/* video */
.video-box { margin-top: 10px; }
.video-box .btn { font-weight: 600; }
.howto { color: var(--grey-2); font-size: 14px; }

/* phrase */
.phrase { font-size: 19px; font-weight: 600; line-height: 1.4; }

/* buttons */
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  background: var(--ink); color: var(--paper); font-weight: 500; font-size: 15px;
  padding: 15px; border: 1.5px solid var(--ink);
}
.btn.ghost { background: var(--paper); color: var(--ink); }
.link-btn { text-decoration: underline; text-underline-offset: 3px; font-size: 13px; align-self: center; }

/* checkboxes */
li.chk { list-style: none; margin-left: -20px; }
li.chk label { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
li.chk input {
  appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 2px 0 0;
  border: 1.5px solid var(--ink); background: var(--paper); display: grid; place-content: center;
}
li.chk input:checked { background: var(--ink); }
li.chk input:checked::after { content: ""; width: 9px; height: 5px; border: solid var(--paper); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }

details { border-top: 0.5px solid var(--line); border-bottom: 0.5px solid var(--line); margin: 16px 0; padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
summary::-webkit-details-marker { display: none; }
.det { padding-top: 4px; }

/* lists of days */
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 0.5px solid var(--line); text-decoration: none;
}
.row .r { font-size: 12px; color: var(--grey); white-space: nowrap; }
.row.cur .l { font-weight: 600; }
.row .tick { font-size: 12px; border: 1px solid var(--ink); padding: 0 6px; }
.week-h { font-size: 12px; color: var(--grey); margin: 24px 0 2px; }

/* bottom nav: always visible */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--paper); border-top: 0.5px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px calc(14px + var(--safe-b)); font-size: 13px;
}
.nav a { text-decoration: none; }
.nav a.off { color: #c8c8c8; pointer-events: none; }
.nav #today { text-decoration: underline; text-underline-offset: 4px; }

/* menu */
.menu {
  position: fixed; inset: 0; z-index: 20; background: var(--paper); overflow-y: auto;
  padding: calc(16px + var(--safe-t)) 20px calc(30px + var(--safe-b));
}
.menu[hidden] { display: none; }
.menu-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.close { font-size: 20px; line-height: 1; padding: 4px; }
.menu h1 { font-size: 27px; font-weight: 700; letter-spacing: -0.4px; margin: 18px 0 8px; }
.menu .row { font-size: 16px; }

/* done screen */
.center { text-align: center; }
