/* Colours copied from the Kieli Android app (res/values/colors.xml) */
:root {
  --background: #F6F6F6;
  --row: #FFFFFF;
  --to: #324394;
  --from: #696868;
  --highlight: #E69138;
  --tab: #324394;
  --line: rgba(0,0,0,.12);
  --muted: #9a9a9a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #e9ebf2;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #000;
  display: flex; flex-direction: column; align-items: center;
}
button { font: inherit; cursor: pointer; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }

/* --- small site header above the "phone" --- */
.site {
  width: 100%; max-width: 560px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
}
.site-icon { width: 40px; height: 40px; border-radius: 10px; }
.site-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.site-text strong { font-size: 18px; color: var(--to); }
.site-text span { font-size: 13px; color: var(--from); }
.get-app {
  background: var(--to); color: #fff; border: 0; border-radius: 20px;
  padding: 8px 16px; font-weight: 600; white-space: nowrap;
}

/* --- the app itself --- */
.phone {
  position: relative;
  width: 100%; max-width: 560px;
  flex: 1; min-height: 0;
  background: var(--background);
  display: flex; flex-direction: column;
  overflow: hidden;
}
@media (min-width: 600px) {
  .phone { border-radius: 24px 24px 0 0; box-shadow: 0 4px 30px rgba(50,67,148,.18); }
}

.topbar {
  display: flex; align-items: center; gap: 8px;
  padding-inline: 16px 8px; min-height: 56px;
}
.topbar h1 { font-size: 17px; font-weight: 500; margin: 0; white-space: nowrap; }
.cat-btn {
  margin-inline-start: auto; max-width: 75%;
  background: none; border: 0; border-radius: 4px; padding: 8px;
  color: var(--to); font-weight: 600; text-align: end;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-btn:hover, .lang-btn:hover, .swap:hover { background: rgba(50,67,148,.07); }

.menu {
  position: absolute; z-index: 20;
  background: #fff; border-radius: 4px;
  box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
  max-height: 70vh; overflow-y: auto; padding: 8px 0;
}
#catMenu { inset-inline-end: 8px; top: 48px; width: min(340px, calc(100% - 16px)); }
.menu-group { font-size: 12px; font-weight: 700; color: gray; padding: 8px 16px 4px; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; text-align: start;
  padding: 10px 16px; font-size: 16px; color: #000;
}
.menu-item:hover { background: rgba(0,0,0,.05); }
.menu-item .check { width: 18px; height: 18px; visibility: hidden; }
.menu-item.selected .check { visibility: visible; }
.menu-item .lock { width: 16px; height: 16px; margin-inline-start: auto; color: var(--muted); }
.menu-item.locked { color: #8a8a8a; }

.search {
  display: flex; align-items: center; gap: 12px;
  background: var(--row); margin: 0; padding: 0 16px; height: 56px;
}
.search input {
  flex: 1; border: 0; outline: 0; font-size: 18px; background: transparent; color: #000; min-width: 0;
}

.langs {
  display: flex; align-items: center; gap: 4px;
  padding: 16px 16px 8px;
}
.lang-wrap { position: relative; flex: 1; min-width: 0; }
.lang-btn {
  width: 100%; display: flex; align-items: center; gap: 6px;
  background: none; border: 0; border-radius: 4px; padding: 8px;
  color: var(--to); font-size: 15px; font-weight: 500; text-align: start;
}
.lang-wrap.right .lang-btn { justify-content: flex-end; text-align: end; }
.flag { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.lang-menu { top: 44px; inset-inline-start: 0; width: 260px; }
.lang-wrap.right .lang-menu { inset-inline-start: auto; inset-inline-end: 0; }
.swap { background: none; border: 0; border-radius: 4px; padding: 8px 12px; color: var(--to); }

.list { flex: 1; overflow-y: auto; padding: 0 0 12px; }

.card {
  background: var(--row); margin: 8px; border-radius: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,.14), 0 1px 8px rgba(0,0,0,.08);
}
.pair { display: flex; align-items: flex-start; gap: 8px; padding: 16px; }
.pair + .pair { border-top: 1px solid var(--line); }
.vdiv { width: 1px; height: 32px; background: #d3d3d3; opacity: .5; flex: none; }
.cell { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.cell .txt { flex: 1; min-width: 0; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.cell.from .txt { color: var(--from); }
.cell.to .txt { color: var(--to); }
.txt a { color: inherit; text-decoration: none; }
.txt a:hover { text-decoration: underline; }
.txt mark { background: none; color: var(--highlight); }

.play {
  background: none; border: 0; padding: 0; width: 24px; height: 24px; color: var(--to);
  border-radius: 50%;
}
.play.faded { opacity: .28; }
.play.faded:hover { opacity: .5; }
.play.playing { color: var(--highlight); }

.empty { text-align: center; color: var(--from); padding: 32px 16px; }

/* locked category panel */
.locked-panel {
  margin: 16px 8px; background: var(--row); border-radius: 15px; padding: 28px 20px;
  text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,.14), 0 1px 8px rgba(0,0,0,.08);
}
.locked-panel .big-lock {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
  background: rgba(50,67,148,.1); color: var(--to);
  display: flex; align-items: center; justify-content: center;
}
.locked-panel h2 { font-size: 19px; margin: 0 0 8px; color: var(--to); }
.locked-panel p { color: var(--from); margin: 0 auto 18px; max-width: 360px; line-height: 1.45; }
.badges { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.badges img { height: 44px; display: block; }
.badges a.play-store img { height: 56px; margin: -6px -4px; }

/* bottom navigation like the app */
.tabs {
  display: flex; background: #fff; height: 56px;
  box-shadow: 0 -1px 4px rgba(0,0,0,.08);
}
.tab {
  flex: 1; background: none; border: 0; padding: 6px 0 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--tab); opacity: .4; font-size: 12px; position: relative;
}
.tab.active { opacity: 1; }
.tab .mini-lock { position: absolute; top: 4px; left: calc(50% + 8px); width: 12px; height: 12px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
  background: #323232; color: #fff; padding: 12px 16px; border-radius: 8px;
  font-size: 14px; max-width: calc(100% - 32px); width: max-content;
  box-shadow: 0 3px 10px rgba(0,0,0,.25); z-index: 40;
}
.toast a { color: #ffcf99; font-weight: 600; margin-inline-start: 10px; cursor: pointer; }

.ui-select {
  width: 100%; margin: 0 0 20px; padding: 10px 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--to); border-radius: 10px; background: #fff; color: var(--to);
}

/* bottom sheet */
.sheet-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-bg[hidden] { display: none; }
.sheet {
  background: #fff; width: 100%; max-width: 560px; border-radius: 20px 20px 0 0;
  padding: 24px 20px 28px; max-height: 85vh; overflow-y: auto; position: relative;
}
.sheet h2 { margin: 0 0 8px; color: var(--to); font-size: 20px; padding-inline-end: 32px; }
.sheet p { color: var(--from); line-height: 1.45; margin: 0 0 16px; }
.sheet ul { color: var(--from); line-height: 1.6; margin: 0 0 18px; padding-inline-start: 20px; }
.sheet .close { position: absolute; top: 14px; inset-inline-end: 14px; background: none; border: 0; color: var(--from); padding: 4px; }
.sheet .seg { display: flex; gap: 8px; margin: 0 0 20px; }
.sheet .seg button {
  flex: 1; border: 1px solid var(--to); background: #fff; color: var(--to);
  border-radius: 20px; padding: 8px;
}
.sheet .seg button.on { background: var(--to); color: #fff; }
.sheet h3 { font-size: 14px; color: var(--from); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }

@media (max-width: 420px) {
  .site-text span { display: none; }
  .site-text strong { font-size: 16px; }
  .get-app { padding: 7px 12px; font-size: 14px; white-space: normal; max-width: 45%; }
  .lang-btn { font-size: 14px; }
}
