@font-face {
  font-family: Heebo;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/heebo-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Heebo;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/heebo-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Heebo;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/heebo-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Heebo has no Cyrillic. Its Latin letters come from Roboto, so Russian text uses Roboto's Cyrillic
   under the same family name: one weight axis from 100 to 900 in one file. */
@font-face {
  font-family: Heebo;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/roboto-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Heebo;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/heebo-hebrew-400-normal.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: Heebo;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/heebo-hebrew-600-normal.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: Heebo;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/heebo-hebrew-700-normal.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

:root {
  color-scheme: light;
  --screen: #f7f9fc;
  --card: #ffffff;
  --border: #dde3ea;
  --text: #1b2430;
  --secondary-text: #55616f;
  --placeholder: #66727f;
  --primary: #1565c0;
  --on-primary: #ffffff;
  --secondary: #00796b;
  --secondary-container: #d6f0eb;
  --on-secondary-container: #00574c;
  --disabled-fill: #e6eaef;
  --disabled-text: #7a8693;
  --camera-off: #1b2430;
  --camera-off-circle: #2a3544;
  --camera-off-text: #e3e9ef;
  --warning: #b26a00;
  --handle: #c5cdd6;
  --empty-icon: #9aa5b1;
  --pill-off-text: #0d47a1;
  --offline-bg: #fdf0d9;
  --offline-text: #5c3700;
  --follow-bg: #d6f0eb;
  --follow-text: #00463d;
  --word-bg: #00796b;
  --word-text: #ffffff;
  --scrim: rgba(0, 0, 0, 0.5);
  --viewport-height: 100dvh;
  --sheet-height: 220px;
  font-family: Heebo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --screen: #121820;
    --card: #1b2430;
    --border: #2e3a48;
    --text: #e8eef6;
    --secondary-text: #b7c1cd;
    --placeholder: #8e9aab;
    --primary: #1565c0;
    --on-primary: #ffffff;
    --secondary: #00796b;
    --secondary-container: #0f3d36;
    --on-secondary-container: #b7ebe3;
    --disabled-fill: #2a333d;
    --disabled-text: #8b97a6;
    --camera-off: #0e141b;
    --camera-off-circle: #243140;
    --camera-off-text: #e3e9ef;
    --warning: #e6a23c;
    --handle: #3e4c5c;
    --empty-icon: #8e9aab;
    --pill-off-text: #0d47a1;
    --offline-bg: #3a2b12;
    --offline-text: #ffd89a;
    --follow-bg: #0f3d36;
    --follow-text: #c9f2ea;
    --word-bg: #00796b;
    --word-text: #ffffff;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--camera-off);
  color: var(--text);
}

button, textarea, input { font-family: inherit; }

button {
  cursor: pointer;
}

button:disabled { cursor: default; }

button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

#app, .screen { height: 100%; }

.screen { height: 100dvh; }

.screen[hidden] { display: none !important; }

.stage {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--camera-off);
}

.preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  background: var(--camera-off);
}

.preview.is-still {
  inset: auto;
  object-fit: contain;
  background: transparent;
}

.viewport {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: var(--sheet-height);
  z-index: 1;
  touch-action: none;
}

.frame {
  position: absolute;
  border: 2px solid #fff;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.scrim {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 110px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--scrim), transparent);
}

.placeholder {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: var(--sheet-height);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  color: var(--camera-off-text);
}

/* The camera is off: the whole picture turns it on. */
.placeholder.is-tappable { cursor: pointer; }

.placeholder.is-tappable:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -8px;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--camera-off-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--camera-off-text);
}

.placeholder p {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 22px;
}

.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.pill {
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--pill-off-text);
  font-size: 14px;
  font-weight: 600;
}

.topbar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 16px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: block;
}

/* The camera button stands at the start of the top bar; Install (Android), Saved pages and the menu at its end, also when the camera button is hidden.
   Only the first shown of them takes the free space, so Install stays beside Saved pages. */
.topbar-end { margin-inline-start: auto; }
.topbar-end:not([hidden]) ~ .topbar-end { margin-inline-start: 0; }

/* Install on the top bar (Android): a dark pill like the camera button, readable over any picture. */
.install-top {
  flex: none;
  height: 44px;
  margin-inline-end: 4px;
  padding-block: 0;
  padding-inline: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 26, 34, 0.62);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-button.on-camera { color: #fff; }

.icon-button:disabled { color: rgba(255, 255, 255, 0.4); }

.camera-toggle {
  background: rgba(20, 26, 34, 0.62);
  color: #fff;
}

.camera-toggle.is-closed {
  background: #fff;
  color: var(--pill-off-text);
}

.camera-toggle:disabled {
  background: var(--disabled-fill);
  color: var(--disabled-text);
}

.sheet {
  --bottom-pad: max(28px, env(safe-area-inset-bottom));
  --status-extra: 0px;
  --peek: calc(180px + var(--status-extra) + var(--bottom-pad));
  --open: max(var(--peek), calc(var(--viewport-height) - env(safe-area-inset-top) - 88px));
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--peek);
  display: flex;
  flex-direction: column;
  padding: 0 16px var(--bottom-pad);
  border-radius: 28px 28px 0 0;
  background: var(--screen);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.16);
  transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sheet.is-open { height: var(--open); }

/* While a finger drags it, the sheet follows at once; let go, it glides to its height. */
.sheet.is-dragging { transition: none; }

.sheet.has-status { --status-extra: 48px; }

@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
}

.handle {
  flex: 0 0 auto;
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--handle);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 0 0;
  touch-action: none;
}

.handle span {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--handle);
}

.usage {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 36px;
  padding: 0 4px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  /* The credit line drags the sheet too: the browser does not take the gesture for a scroll. */
  touch-action: none;
}

.usage-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.usage-spacer { flex: 1; }

.menu-anchor { position: relative; }

.voice-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.voice-button:disabled {
  background: var(--disabled-fill);
  color: var(--disabled-text);
  box-shadow: none;
}

.listening {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.text-card {
  flex: 1;
  min-height: 0;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  overflow: hidden;
}

textarea {
  flex: 1;
  width: 100%;
  min-height: 0;
  resize: none;
  border: 0;
  margin: 0;
  padding: 16px 18px;
  background: transparent;
  color: var(--text);
  font-size: 20px;
  line-height: 34px;
  text-align: start;
}

textarea::placeholder { color: var(--placeholder); }

.text-card[hidden] { display: none; }

/* The text while it is read aloud: one block for each line of the text, the one being read marked,
   the ones already read greyer. A blank line in the text parts paragraphs (docs/behavior.md). */
.text-view {
  display: block;
  overflow-y: auto;
  padding: 12px 10px;
  color: var(--text);
  font-size: 20px;
  line-height: 34px;
}

.unit {
  margin: 0;
  padding: 2px 8px;
  border-radius: 10px;
  transition: background-color 200ms, color 200ms;
}

.unit.is-paragraph { margin-top: 14px; }

.follows .unit { cursor: pointer; }

.unit.is-current {
  background: var(--follow-bg);
  color: var(--follow-text);
}

.unit.is-past { color: var(--secondary-text); }

/* The word being read, in the line being read; a tap plays it alone (docs/behavior.md#tap-a-word).
   The padding widens the mark and the margin takes it back, so the letters never move. */
.word {
  padding: 2px 3px;
  margin: 0 -3px;
  border-radius: 6px;
  transition: background-color 120ms, color 120ms;
}

.has-words .word { cursor: pointer; }

.word.is-word {
  background: var(--word-bg);
  color: var(--word-text);
}

@media (prefers-reduced-motion: reduce) {
  .unit, .word { transition: none; }
}

.playback-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.speed-button,
.round-button {
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.speed-button { width: 72px; }

.round-button {
  width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.speed-button:disabled,
.round-button:disabled {
  background: var(--disabled-fill);
  color: var(--disabled-text);
}

.action {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 16px;
  font-weight: 600;
}

.action-primary {
  width: 100%;
  margin-top: 12px;
  background: var(--primary);
  color: var(--on-primary);
}

/* A photo from the gallery, before Capture, as in a camera app. */
.capture-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.capture-row[hidden] { display: none; }

.capture-row .action-primary {
  flex: 1;
  min-width: 0;
  width: auto;
  margin-top: 0;
}

.action-speak {
  flex: 1;
  min-width: 0;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.action-speak.is-stop {
  background: var(--secondary);
  color: #fff;
}

.action:disabled {
  background: var(--disabled-fill);
  color: var(--disabled-text);
}

/* A button at work keeps its colour: it is busy, not unavailable. */
.action-primary.is-busy:disabled {
  background: var(--primary);
  color: var(--on-primary);
}

.action-speak.is-busy:disabled {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

/* The loading indicator of Capture and Read aloud: an arc turning over a faint ring. */
.spinner {
  display: block;
  animation: spinner-turn 0.9s linear infinite;
}

.spinner-track { opacity: 0.28; }

@keyframes spinner-turn {
  to { transform: rotate(360deg); }
}

@keyframes spinner-pulse {
  50% { opacity: 0.4; }
}

/* With reduced motion set on the phone, it pulses instead of turning. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: spinner-pulse 1.6s ease-in-out infinite; }
}

.action span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0 4px;
  color: var(--secondary-text);
  font-size: 13px;
  line-height: 18px;
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--warning);
  flex: 0 0 auto;
}

.status-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* No credits: Buy credits beside the words, or under them when the line is too narrow for both. */
.status.has-buy {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 8px;
}

.status.has-buy .status-dot { margin-top: 0; }

.status.has-buy .status-text { flex: 1 1 150px; }

.status-buy {
  flex: none;
  min-height: 40px;
  margin-inline-start: auto;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.status-buy[hidden] { display: none; }

.menu {
  position: absolute;
  z-index: 6;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  min-width: 180px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.menu-up {
  top: auto;
  inset-inline-end: auto;
  inset-inline-start: 0;
  bottom: calc(100% + 4px);
}

.menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: start;
  font-size: 16px;
  padding: 10px 12px;
}

.menu button[aria-checked="true"] { font-weight: 600; }

.sub {
  display: flex;
  flex-direction: column;
  background: var(--screen);
  color: var(--text);
}

.titlebar {
  display: flex;
  align-items: center;
  padding: env(safe-area-inset-top) 0 0;
  padding-inline-end: 8px;
  min-height: 56px;
}

.titlebar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.list-body {
  flex: 1;
  overflow: auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.empty-pages {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  color: var(--placeholder);
  text-align: center;
}

.empty-pages .empty-icon { color: var(--empty-icon); }

.page-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

/* Saved pages: how long their files are kept. */
.list-note {
  margin: 0;
  padding: 8px 16px 0;
  color: var(--secondary-text);
  font-size: 13px;
  line-height: 18px;
}

.detail-gone {
  margin: 12px 4px 0;
  color: var(--secondary-text);
  font-size: 14px;
  line-height: 20px;
}

/* The heading of a group of saved pages (Today, Yesterday, ...); it stays at the top while its pages scroll by. */
.list-group {
  position: sticky;
  top: -1px;
  z-index: 1;
  margin: 0;
  padding: 18px 16px 6px;
  background: var(--screen);
  color: var(--secondary-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.page-main {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  padding: 12px 0 12px 16px;
}

.page-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  line-height: 22px;
  color: var(--text);
}

.page-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: var(--secondary-text);
  font-size: 13px;
}

.page-meta .when {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.meta-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 8px;
}

.detail-scroll {
  flex: 1;
  overflow: auto;
  padding: 0 16px 16px;
}

.detail-photo {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 20px;
  background: var(--card);
  margin-bottom: 12px;
}

.when {
  margin: 0;
  color: var(--secondary-text);
  font-size: 13px;
}

.transcript {
  margin: 12px 0 0;
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  font-size: 20px;
  line-height: 34px;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
}

.stats {
  margin-top: 12px;
  color: var(--secondary-text);
  font-size: 13px;
  line-height: 18px;
}

.stats p { margin: 0; padding: 0 4px; }

.detail-error {
  margin: 8px 0 0;
  color: var(--warning);
  font-size: 13px;
}

.detail-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}

.detail-play { flex: 0 1 auto; }

.delete-button {
  margin-inline-start: auto;
  color: var(--warning);
}

dialog {
  border: 0;
  border-radius: 28px;
  padding: 24px;
  width: min(360px, calc(100% - 48px));
  background: var(--screen);
  color: var(--text);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.5); }

#dialog-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

#dialog-message {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
}

dialog.is-titled #dialog-message {
  color: var(--secondary-text);
  font-size: 14px;
  line-height: 20px;
}

dialog.is-replace #dialog-message { font-size: 18px; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.dialog-actions button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  padding: 10px;
}

#dialog-confirm.is-danger { color: var(--warning); }

svg { display: block; }

/* Sign-in and registration */

.auth {
  background: var(--screen);
  color: var(--text);
  overflow-y: auto;
}

.auth-scroll {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

.auth-card {
  width: min(400px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-brand-name {
  font-weight: 600;
  font-size: 18px;
}

/* The language of the sign-in screen: a pill at the end of the logo row; the browser's own list of the select opens. */
.language-pill {
  position: relative;
  flex: none;
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding-block: 0;
  padding-inline: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.language-pill select {
  position: absolute;
  /* Over the whole button, its border too, so a tap anywhere on it opens the list. */
  inset: -1px;
  margin: 0;
  border-radius: inherit;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}

.language-pill:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.auth h1 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  color: var(--secondary-text);
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
}

.field select { appearance: auto; }

.field-first { margin-top: 0; }

/* In Hebrew the screens run right to left; Back points the other way, and so does the arrow of a settings row. */
[dir="rtl"] [data-icon="back"] svg,
[dir="rtl"] [data-icon="forward"] svg { transform: scaleX(-1); }

.field input:focus-visible,
.field select:focus-visible {
  outline-offset: 0;
  border-color: var(--primary);
}

.auth-hint {
  margin: 12px 0 0;
  color: var(--secondary-text);
  font-size: 13px;
  line-height: 18px;
}

.form-error {
  margin: 12px 0 0;
  color: var(--warning);
  font-size: 14px;
  line-height: 20px;
}

.form-error.is-ok { color: var(--secondary); }

.auth .action-primary { margin-top: 20px; }

.auth .action-google {
  width: 100%;
  margin-top: 12px;
  background: #4285f4;
  color: #fff;
  text-decoration: none;
}

.auth-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 12px 0 0;
  color: var(--secondary-text);
  font-size: 14px;
}

.auth-text {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.auth-sent .action-secondary { margin-top: 20px; }

.auth-restart {
  display: block;
  margin: 8px auto 0;
}

/* Forgot password?, under the sign-in form, above “No account yet?”. */
.auth-forgot {
  margin: 4px 0 0;
  text-align: center;
}

/* A small line under the sign-in form, to the privacy page, before an account exists. */
.auth-privacy {
  margin: 2px 0 0;
  text-align: center;
}

.auth-privacy a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  color: var(--secondary-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.link-button {
  min-height: 44px;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .link-button { color: #90caf9; }
}

/* Settings */

.account-scroll {
  flex: 1;
  overflow: auto;
  padding: 0 16px 16px;
}

.sub:not(.has-footer) .account-scroll {
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* The colours of Settings, and of the screens it opens: Plans & credits, and Privacy with its tabs. */
#screen-account,
#screen-credits,
#screen-privacy {
  --set-blue: #4479CB;
  --set-tint: #EAF0FF;
  --set-on-tint: #2458A8;
  --set-ink: #111827;
  --set-amber: #F1B345;
  --set-amber-ink: #8A5A10;
  color: var(--set-ink);
}

@media (prefers-color-scheme: dark) {
  #screen-account,
  #screen-credits,
  #screen-privacy {
    --set-blue: #6b97e0;
    --set-tint: #1c2a44;
    --set-on-tint: #d5e2ff;
    --set-ink: var(--text);
    --set-amber: #F1B345;
    --set-amber-ink: #F1B345;
  }
}

#screen-account .titlebar h1,
#screen-credits .titlebar h1 {
  font-size: 20px;
  font-weight: 600;
}

.account-card {
  margin: 12px 0 0;
  padding: 16px;
  border-radius: 16px;
  background: var(--card);
}

.account-label {
  margin: 0;
  color: var(--secondary-text);
  font-size: 14px;
  font-weight: 400;
}

.account-email {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.account-note {
  margin: 0;
  color: var(--secondary-text);
  font-size: 14px;
}

.action-secondary {
  width: 100%;
  margin-top: 16px;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.action-link {
  text-decoration: none;
}

.action-quiet {
  width: 100%;
  margin-top: 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--warning);
}

.about-version {
  margin: 0;
  color: inherit;
  font-size: 14px;
}

.settings-admin {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  margin-top: 8px;
  padding-inline: 16px;
  border-radius: 16px;
  background: var(--set-tint);
  color: var(--set-on-tint);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

button.settings-admin {
  width: 100%;
  border: 0;
  font-family: inherit;
  text-align: start;
}

.settings-admin [data-icon] { flex: none; }

.settings-admin [data-icon="forward"] { margin-inline-start: auto; }

.settings-badge {
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
}

.settings-stats {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.settings-stat {
  flex: 1;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--screen);
}

.settings-stat [data-icon] {
  grid-row: 1 / span 2;
  color: var(--set-blue);
}

.settings-stat-value {
  font-size: 20px;
  font-weight: 600;
  line-height: 24px;
}

.settings-stat-label {
  color: var(--secondary-text);
  font-size: 14px;
  line-height: 18px;
}

.settings-used { margin-top: 8px; }

.settings-used summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  color: var(--secondary-text);
  font-size: 14px;
  list-style: none;
  cursor: pointer;
}

.settings-used summary::-webkit-details-marker { display: none; }

.settings-used[open] [data-icon="expand"] svg { transform: rotate(180deg); }

.settings-buy {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border-radius: 16px;
  background: var(--set-blue);
  color: var(--on-primary);
}

/* Plans & credits. Prices and times stay in their own direction so shekels and digits do not flip. */
.credits-titlebar .brand-mark { margin-inline-end: 8px; }

.credits-balance { display: flex; flex-direction: column; align-items: flex-start; }

.credits-kicker {
  margin: 0;
  color: var(--secondary-text);
  font-size: 16px;
}

.credits-count,
.credits-time {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 2px 0 0;
}

.credits-count {
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}

.credits-time {
  margin-top: 4px;
  color: var(--secondary-text);
  font-size: 16px;
  line-height: 1;
}

.credits-count [data-icon],
.credits-time [data-icon] {
  display: flex;
  line-height: 0;
  color: var(--set-blue);
}

.credits-chip[hidden] { display: none; }

.credits-chip {
  margin: 12px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--set-tint);
  color: var(--set-on-tint);
  font-size: 16px;
  font-weight: 600;
}

.credits-chip.is-neutral {
  background: var(--disabled-fill);
  color: var(--secondary-text);
}

.credits-explain {
  margin: 12px 0 0;
  color: var(--secondary-text);
  font-size: 16px;
  line-height: 1.4;
}

.credits-message { margin: 12px 4px 0; }

.credits-error {
  margin-top: 16px;
  font-size: 16px;
}

.credits-error[hidden] { display: none; }

.credits-when {
  margin: 12px 0 0;
}

.credits-when[hidden] { display: none; }

#credits-cancel {
  align-self: stretch;
  margin-top: 12px;
  min-height: 48px;
}

.credits-cancel {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--secondary-text);
}

#credits-cancel[hidden] { display: none; }

.credits-offer-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.credits-offer-title[hidden] { display: none; }

.credits-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--screen);
}

.credits-tabs[hidden] { display: none; }

.credits-tabs button {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--set-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
}

.credits-tabs button[aria-selected="true"] {
  background: var(--set-blue);
  color: #fff;
}

.plan-list {
  display: grid;
  gap: 12px;
}

.credits-offer .credits-tabs:not([hidden]) + .plan-list { margin-top: 12px; }

.plan-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--set-ink);
  font: inherit;
  font-size: 16px;
  text-align: start;
}

.plan-card[aria-checked="true"] {
  border-color: var(--set-blue);
  background: var(--set-tint);
}

.plan-card.is-current {
  border-color: var(--border);
  background: var(--card);
  cursor: default;
}

.plan-card.is-current .plan-check { display: none; }

.plan-check {
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--secondary-text);
  border-radius: 50%;
}

.plan-card[aria-checked="true"] .plan-check {
  border-color: var(--set-blue);
  background: var(--set-blue);
}

.plan-card[aria-checked="true"] .plan-check {
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-card[aria-checked="true"] .plan-check::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  margin-bottom: 2px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.plan-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.plan-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-name { font-size: 18px; font-weight: 600; }

.plan-discount[hidden],
.plan-current[hidden],
.plan-old[hidden] { display: none; }

.plan-current {
  flex: none;
  border-color: transparent;
  background: var(--disabled-fill);
  color: var(--secondary-text);
}

.plan-discount {
  flex: none;
  border-color: transparent;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.plan-old {
  margin-inline-end: 6px;
  color: var(--secondary-text);
  font-size: 16px;
  font-weight: 400;
}

.credits-test {
  margin: 0 4px 12px;
  color: var(--warning);
}

.plan-amount {
  color: var(--secondary-text);
  font-size: 16px;
  line-height: 1.35;
}

.plan-price {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.credits-how {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.credits-how li {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  font-size: 16px;
}

.credits-how li span { line-height: 1; }

.credits-how:empty { display: none; }

.credits-how svg { flex: none; color: var(--set-blue); }

.credits-offer .action {
  width: 100%;
  margin-top: 16px;
  background: var(--set-blue);
  color: #fff;
}

.credits-offer .action[hidden] { display: none; }

.credits-pay-note,
.credits-cap {
  margin: 8px 0 0;
  color: var(--secondary-text);
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
}

.credits-cap { margin: 16px 0 0; color: var(--warning); text-align: start; }

.credits-cap[hidden],
#credits-vat[hidden] { display: none; }

.settings-group-title {
  margin: 20px 4px 8px;
  color: var(--secondary-text);
  font-size: 14px;
  font-weight: 600;
}

.settings-group {
  overflow: hidden;
  border-radius: 16px;
  background: var(--card);
}

.settings-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding-inline: 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  text-align: start;
}

.settings-group .settings-row:last-child { border-bottom: 0; }

.settings-row > [data-icon] {
  flex: none;
  color: var(--secondary-text);
}

.settings-row > [data-icon="forward"] {
  margin-inline-start: auto;
  color: var(--placeholder);
}

.settings-row-end {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 55%;
  margin-inline-start: auto;
  color: var(--secondary-text);
  font-size: 14px;
  font-weight: 400;
}

.settings-row-end [data-icon] { flex: none; }

/* English, Русский and עברית share one width, so the value does not jump between them. */
.settings-language-name {
  display: inline-grid;
  min-width: 0;
}

.settings-language-name > span {
  grid-area: 1 / 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: end;
}

.settings-language-name > span[aria-hidden="true"] { visibility: hidden; }

.settings-language select {
  position: absolute;
  inset: 0;
  margin: 0;
  border: 0;
  outline: none;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}

.settings-language:has(select:focus-visible) {
  outline: 2px solid var(--set-blue);
  outline-offset: -2px;
}

.settings-signout { color: var(--set-amber-ink); }

.settings-signout > [data-icon] { color: var(--set-amber); }

.settings-group .form-error {
  margin: 0;
  padding: 0 16px 12px;
}

#password-form { margin-top: 8px; }

.settings-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  color: var(--secondary-text);
  font-size: 14px;
  line-height: 18px;
}

.settings-footer-meta {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.settings-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 6px;
  margin: 0;
}

/* In AlefLens for Android, the version of the app, on a line of its own under the version of the site. */
.native-version { flex-basis: 100%; }

.settings-identity .brand-mark {
  width: 16px;
  height: 16px;
}

.settings-identity #app-version:not([hidden])::before {
  content: "·";
  margin-inline: 4px;
}

.settings-support {
  color: var(--set-blue);
  font-size: 14px;
}

.contact-mail {
  min-width: 0;
  color: inherit;
  overflow-wrap: anywhere;
  text-underline-offset: 2px;
}

/* No connection to the service (docs/offline.md) */

.offline-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--offline-bg);
  color: var(--offline-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.offline-note[hidden] { display: none; }

.offline-note [data-icon] {
  display: inline-flex;
  flex: 0 0 auto;
}

.offline-text {
  display: flex;
  flex-direction: column;
}

.offline-hint {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
}

/* On the camera, below the top bar; the frame moves below it (layoutFrame). */
.offline-note.on-camera {
  position: absolute;
  z-index: 3;
  top: calc(76px + env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(14, 20, 27, 0.8);
  color: #ffffff;
}

.auth-card .offline-note { margin: 0 0 20px; }

/* Without a connection, a saved page whose audio is not on the phone is grey. */
.page-row.is-unkept .page-main { opacity: 0.5; }

/* A new version of the site is ready */

.update-bar {
  position: fixed;
  z-index: 20;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 8px 8px 16px;
  border-radius: 16px;
  background: var(--text);
  color: var(--screen);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 14px;
  line-height: 20px;
}

.update-bar p {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.update-bar button {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.update-later {
  background: transparent;
  color: inherit;
}

.update-now {
  background: var(--primary);
  color: var(--on-primary);
}

.update-now:disabled {
  background: var(--disabled-fill);
  color: var(--disabled-text);
}

/* Install the app (sign-in screen) */

.install-box {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.action-install {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--primary);
}

@media (prefers-color-scheme: dark) {
  .action-install { color: #90caf9; }
}

.install-hint { text-align: center; }

/* AlefLens for Android, /apk (docs/android.md) */

.android-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 8px 4px;
  text-align: center;
}

.android-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.android-lead {
  max-width: 420px;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
}

.android-body .action-primary {
  margin-top: 20px;
}

.android-version {
  margin: 10px 0 0;
  color: var(--secondary-text);
  font-size: 14px;
  text-align: center;
}

.android-steps {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding-inline-start: 22px;
  font-size: 15px;
  line-height: 22px;
}

.android-note {
  margin: 16px 0 0;
  color: var(--secondary-text);
  font-size: 14px;
  line-height: 20px;
}

/* Privacy policy: one language at a time, under tabs named in their languages (docs/behavior.md#privacy).
   The band of the tabs stays at the top of the scroll, over the text that passes under it. */

#privacy-body .privacy-tabs-band {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 -16px 16px;
  padding: 8px 16px;
  background: var(--screen);
}

#privacy-body .privacy-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

#privacy-body .privacy-tabs button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
}

#privacy-body .privacy-tabs button[aria-selected="true"] {
  background: var(--set-blue);
  color: #fff;
}

#privacy-body .privacy-tabs button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

#privacy-body h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

#privacy-body h3 {
  margin: 20px 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

#privacy-body p,
#privacy-body li {
  font-size: 16px;
  line-height: 24px;
}

#privacy-body p { margin: 0 0 12px; }

#privacy-body ul {
  margin: 0 0 12px;
  padding-inline-start: 22px;
}

#privacy-body li { margin: 0 0 8px; }

#privacy-body li:last-child { margin-bottom: 0; }

#privacy-body a {
  color: var(--primary);
  text-decoration: none;
}


@media (prefers-color-scheme: dark) {
  #privacy-body a { color: #90caf9; }
}

