/* Swipeblocked — styles modeled on iOS grouped lists and the system keyboard. */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --cell: #ffffff;
  --cell-pressed: #e5e5ea;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.29);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --bar: rgba(249, 249, 249, 0.82);
  --blue: #007aff;
  --red: #ff3b30;
  --green: #34c759;
  --orange: #ff9500;
  --blue-tint: rgba(0, 122, 255, 0.14);
  --kb: #d1d4da;
  --key: #ffffff;
  --key-fn: #abb0ba;
  --key-edge: #898a8d;
  --trail: rgba(0, 122, 255, 0.55);
  --popover: #ffffff;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  --warn-bg: #fff4e0;
  --warn-edge: rgba(255, 149, 0, 0.45);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system-headline, -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  --col: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --cell: #1c1c1e;
    --cell-pressed: #2c2c2e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.65);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.32);
    --bar: rgba(22, 22, 23, 0.8);
    --blue: #0a84ff;
    --red: #ff453a;
    --green: #30d158;
    --orange: #ff9f0a;
    --blue-tint: rgba(10, 132, 255, 0.24);
    --kb: #2b2b2d;
    --key: #6b6b6e;
    --key-fn: #464649;
    --key-edge: #1a1a1a;
    --trail: rgba(10, 132, 255, 0.6);
    --popover: #2c2c2e;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
    --warn-bg: #3a2a0d;
    --warn-edge: rgba(255, 159, 10, 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 17px/1.4 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Navigation ---------- */

.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--sep);
}
.nav-inner {
  max-width: var(--col); margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; height: 48px;
}
.nav-title { font-weight: 600; color: var(--label); }
.nav-title:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; font-size: 15px; }
.nav-links a { color: var(--label-2); }
.nav-links a[aria-current="page"] { color: var(--blue); }

.tabbar { display: none; }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-inner { justify-content: center; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--sep);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10px; font-weight: 500; color: var(--label-2); letter-spacing: 0;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--blue); }
  .tabbar svg { width: 26px; height: 26px; }
  body { padding-bottom: 84px; }
}

/* ---------- Page structure ---------- */

main { max-width: var(--col); margin: 0 auto; padding: 0 16px 48px; }
.large-title {
  font: 700 34px/41px var(--font-display);
  letter-spacing: 0.01em;
  margin: 20px 0 6px;
}
.dek { font-size: 20px; line-height: 1.35; color: var(--label); margin: 0 0 8px; max-width: 34em; }
.dek-2 { font-size: 17px; color: var(--label-2); margin: 0 0 28px; max-width: 38em; }
.prose { max-width: 38em; }
.prose p { margin: 0 0 14px; }

.section { margin: 44px 0 0; }
.section-title { font: 700 22px/28px var(--font-display); letter-spacing: 0.01em; margin: 0 0 4px; }
.section-sub { color: var(--label-2); margin: 0 0 14px; font-size: 15px; max-width: 38em; }

/* Inset grouped list */
.group-header { font: 600 17px/22px var(--font); margin: 26px 4px 8px; }
.group-header .count { font-weight: 400; color: var(--label-2); margin-left: 6px; }
/* iOS-style pinned section headers: they stick under the nav bar while their section scrolls. */
.group-header.sticky {
  position: sticky; top: 48px; z-index: 5;
  margin: 18px -16px 0; padding: 8px 20px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.group-header.sticky + .list, .group-header.sticky + .words { margin-top: 6px; }
@media (max-width: 640px) { .list-page .group-header.sticky { margin-right: -24px; } }
.list {
  list-style: none; margin: 0; padding: 0;
  background: var(--cell); border-radius: var(--radius); overflow: hidden;
}
.list > li { position: relative; }
.list > li + li::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0;
  border-top: 0.5px solid var(--sep);
}
.list.icons > li + li::before { left: 58px; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; min-height: 44px; width: 100%;
  background: none; border: 0; text-align: left;
}
button.row { cursor: pointer; }
button.row:active { background: var(--cell-pressed); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; }
.row-sub { display: block; font-size: 15px; color: var(--label-2); margin-top: 2px; }
.row-value { color: var(--label-2); font-size: 15px; white-space: nowrap; flex-shrink: 0; }
.row-chev { color: var(--label-3); flex-shrink: 0; width: 8px; height: 13px; }
.group-footer { font-size: 13px; line-height: 18px; color: var(--label-2); margin: 7px 16px 0; max-width: 40em; }

.icon {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
}
.icon svg { width: 18px; height: 18px; }
.i-blue { background: #007aff; } .i-red { background: #ff3b30; } .i-green { background: #34c759; }
.i-orange { background: #ff9500; } .i-gray { background: #8e8e93; } .i-purple { background: #af52de; }
.i-indigo { background: #5856d6; } .i-teal { background: #30b0c7; }

/* "Swipe works" marker for phrases blocked only in suggestions */
.swipe-ok { color: var(--label-2); font-size: 15px; white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; }
.swipe-ok svg { width: 15px; height: 15px; }

/* Segmented control */
.segmented {
  display: flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 0;
  margin: 0 0 4px; overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: 1 0 auto; border: 0; background: none; padding: 6px 12px; border-radius: 7px;
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--label);
}
.segmented button[aria-pressed="true"] {
  background: var(--cell); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: dark) { .segmented button[aria-pressed="true"] { background: #636366; } }

/* Contrast pairs */
.pairs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pairs-head { font-size: 13px; color: var(--label-2); padding: 0 16px 6px; }
.pair-cell { display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 48px; }
.pair-cell svg { width: 22px; height: 22px; flex-shrink: 0; }
.pair-cell.blocked svg { color: var(--red); }
.pair-cell.open svg { color: var(--green); }
.pair-cell.open { color: var(--label-2); }
.pair-note { grid-column: 1 / -1; font-size: 13px; color: var(--label-2); padding: 0 16px 12px; margin-top: -4px; }

/* Foreign-language highlights */
.native { display: block; font-size: 19px; }
[dir="rtl"].native { text-align: right; }

/* ---------- Popover ---------- */

.popover {
  position: absolute; z-index: 40; width: min(340px, calc(100vw - 24px));
  background: var(--popover); border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 0 6px; max-height: min(420px, 70vh); overflow: auto;
  transform-origin: top left; animation: pop 0.18s ease-out;
}
.popover h3 { font-size: 13px; font-weight: 400; color: var(--label-2); margin: 0 16px 6px; }
.popover ul { list-style: none; margin: 0; padding: 0; }
.popover li { padding: 7px 16px; font-size: 16px; border-top: 0.5px solid var(--sep); }
.popover li:first-child { border-top: 0; }
.popover li.so { color: var(--label-2); }
.popover .more { font-size: 13px; color: var(--label-2); padding: 8px 16px 4px; }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .popover { animation: none; } }

/* ---------- Keyboard hero ---------- */

.phone {
  margin: 8px 0 0; background: var(--kb); border-radius: 22px; overflow: hidden;
  max-width: 430px; position: relative; user-select: none; -webkit-user-select: none;
}
.compose { background: var(--cell); padding: 14px 14px 12px; display: flex; align-items: flex-end; gap: 8px; }
.compose-field {
  flex: 1; border: 1px solid var(--sep); border-radius: 18px; padding: 7px 14px;
  font-size: 19px; min-height: 38px; line-height: 1.25; background: var(--cell);
}
.compose-field .w { transition: background-color 0.6s ease; border-radius: 4px; }
.compose-field .w.changed { background: var(--blue-tint); }
.compose-field .w.new { color: var(--label); }
.caret {
  display: inline-block; width: 2px; height: 1.15em; vertical-align: -0.2em; margin-left: 1px;
  background: var(--blue); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.suggest {
  display: grid; grid-template-columns: repeat(3, 1fr); height: 44px; align-items: center;
  font-size: 17px; text-align: center; color: var(--label);
}
.suggest span + span { border-left: 1px solid var(--label-3); }
.suggest span { min-height: 22px; }
.keys { padding: 6px 3px 10px; position: relative; }
.krow { display: flex; justify-content: center; gap: 6px; margin: 0 0 12px; }
.krow:last-child { margin: 0; }
.krow.mid { padding: 0 5%; }
.key {
  flex: 1 1 0; max-width: 46px; height: 45px; background: var(--key); border-radius: 7px;
  box-shadow: 0 1px 0 var(--key-edge); display: grid; place-items: center;
  font-family: var(--font-display); font-size: 27px; font-weight: 400; color: var(--label);
  line-height: 1; padding-bottom: 3px; letter-spacing: 0;
}
.key.fn { background: var(--key-fn); font-family: var(--font); font-size: 16px; padding-bottom: 0; max-width: 50px; flex-basis: 50px; flex-grow: 1.3; }
.key.fn svg { width: 24px; height: 24px; }
/* Shift and delete sit apart from the letters, as on the real keyboard. */
.krow > .key.fn:first-child { margin-right: 8px; }
.krow > .key.fn:last-child:not(.ret) { margin-left: 8px; }
.key.space { max-width: none; flex-grow: 5; font-size: 16px; }
.key.ret { max-width: none; flex-grow: 2; font-size: 16px; }
.key.num { max-width: none; flex-grow: 1.3; font-size: 16px; }
.trail { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.trail path { fill: none; stroke: var(--trail); stroke-linecap: round; stroke-linejoin: round; }
.hero-caption { font-size: 15px; color: var(--label-2); margin: 12px 4px 0; max-width: 520px; }
.hero-controls { margin: 10px 4px 0; display: flex; gap: 16px; align-items: center; }
.text-button { background: none; border: 0; color: var(--blue); padding: 0; cursor: pointer; font-size: 17px; }
.text-button:hover { text-decoration: underline; }

@media (max-width: 420px) {
  .krow { gap: 5px; }
  .key { height: 43px; font-size: 25px; }
  .krow > .key.fn:first-child { margin-right: 4px; }
  .krow > .key.fn:last-child:not(.ret) { margin-left: 4px; }
  .compose-field { font-size: 17px; }
}

/* ---------- Full list ---------- */

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 6px; }
.select {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 9px;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M1 5l4-4 4 4M1 9l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding: 8px 34px 8px 12px; font: 500 15px var(--font); color: var(--label); cursor: pointer;
}
.list-meta { color: var(--label-2); font-size: 15px; }
.index-wrap { position: relative; }
.az {
  position: fixed; right: max(4px, calc((100vw - var(--col)) / 2 - 28px)); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; z-index: 10; font-size: 11px; font-weight: 600;
}
.az a { color: var(--blue); padding: 0 6px; line-height: 15px; text-align: center; }
.az a:hover { text-decoration: none; }
@media (max-width: 640px) { .az { right: 0; } .list-page main { padding-right: 24px; } }
.forms-tag { color: var(--blue); font-size: 15px; white-space: nowrap; }
.loading { color: var(--label-2); padding: 24px 4px; }
.notice { background: var(--cell); border-radius: var(--radius); padding: 12px 16px; font-size: 15px; color: var(--label-2); margin: 0 0 8px; }
.notice strong { color: var(--label); font-weight: 600; }

/* ---------- Word labels ---------- */

.warning {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warn-bg); border: 1px solid var(--warn-edge); border-radius: 12px;
  padding: 14px 16px; font-size: 16px; color: var(--label);
}
.warning svg { width: 26px; height: 26px; flex-shrink: 0; color: var(--orange); margin-top: -1px; }
.warning strong { font-weight: 600; display: block; margin-bottom: 2px; }

.words { columns: 3 11em; column-gap: 0; background: var(--cell); border-radius: var(--radius); padding: 6px 0; }
.words span { display: block; padding: 5px 16px; font-size: 16px; break-inside: avoid; }

/* ---------- Changelog ---------- */

.version { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 34px 4px 8px; }
.version h2 { font: 700 22px/28px var(--font-display); margin: 0; }
.version time { color: var(--label-2); font-size: 15px; white-space: nowrap; }
.version-note { font-size: 13px; color: var(--label-2); margin: -4px 4px 10px; }
.delta { font-size: 15px; color: var(--label-2); margin: 0 4px 8px; }
.delta b { font-weight: 600; }
.delta .plus { color: var(--green); } .delta .minus { color: var(--red); }
.mark { width: 20px; height: 20px; flex-shrink: 0; }
.mark.add { color: var(--green); } .mark.rem { color: var(--red); }

/* ---------- How it works ---------- */

.step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.step-head { display: flex; gap: 12px; align-items: center; margin: 40px 0 8px; }
.step-head h2 { font: 700 22px/28px var(--font-display); margin: 0; }
.demo { background: var(--cell); border-radius: var(--radius); padding: 16px; margin: 14px 0 0; }
.tokens { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.token { background: var(--fill); border-radius: 8px; padding: 6px 10px; text-align: center; min-width: 64px; }
.token .t-word { display: block; font-size: 17px; }
.token .t-num { display: block; font: 500 13px var(--font-mono); color: var(--label-2); margin-top: 2px; }
.token.same { box-shadow: inset 0 0 0 1.5px var(--blue); }
.fp { font: 500 22px var(--font-mono); letter-spacing: 0.04em; }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.verdict svg { width: 20px; height: 20px; }
.verdict.yes { color: var(--red); } .verdict.no { color: var(--green); } .verdict.maybe { color: var(--orange); }
.arrow-down { color: var(--label-3); margin: 8px 0; font-size: 15px; }
.tech-h { margin: 44px 0 10px; }
ol.steps { margin: 12px 0 14px; padding-left: 1.4em; max-width: 38em; }
ol.steps li { margin: 0 0 10px; padding-left: 4px; }
.demo .segmented { margin-bottom: 4px; }
.demo-table { margin-top: 12px; background: var(--fill); }
.demo-table td, .demo-table th { padding: 7px 12px; }
.demo-line { margin: 14px 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
pre.code .c { color: var(--label-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--sep); border-radius: var(--radius); overflow: hidden; margin: 14px 0 0; }
.stats div { background: var(--cell); padding: 12px 16px; }
.stats b { display: block; font: 600 22px var(--font-display); }
.stats span { font-size: 13px; color: var(--label-2); }
pre.code {
  background: var(--cell); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto;
  font: 14px/1.5 var(--font-mono); margin: 12px 0 0;
}
code { font-family: var(--font-mono); font-size: 0.9em; overflow-wrap: anywhere; }
pre code, pre.code { overflow-wrap: normal; }
table.simple { width: 100%; border-collapse: collapse; background: var(--cell); border-radius: var(--radius); overflow: hidden; font-size: 15px; margin: 12px 0 0; }
table.simple th, table.simple td { text-align: left; padding: 9px 16px; border-top: 0.5px solid var(--sep); }
table.simple th { font-weight: 600; border-top: 0; }
table.simple td.n, table.simple th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */

.footer { max-width: var(--col); margin: 56px auto 0; padding: 20px 16px 40px; border-top: 0.5px solid var(--sep); font-size: 13px; color: var(--label-2); }
.footer p { margin: 0 0 6px; max-width: 44em; }
.footer .byline { font-size: 15px; color: var(--label); }
