/* AppNoteBook — Mobile App UI (PWA) */

:root {
  --ink: #14252e;
  --ink-soft: #3a5562;
  --paper: #eef3f5;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #f7fafb;
  --line: rgba(20, 37, 46, 0.1);
  --teal: #1f6f7a;
  --teal-deep: #14555e;
  --teal-soft: #d4e8eb;
  --gold: #b8893a;
  --gold-soft: #f3e6cf;
  --danger: #9b3a3a;
  --danger-soft: #f5e4e4;
  --shadow: 0 12px 40px rgba(20, 37, 46, 0.14);
  --radius: 20px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --nav-h: 72px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-max: 430px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #0f1c22;
  line-height: 1.5;
  overscroll-behavior: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* Phone shell — desktop preview + full-bleed on real phones */
.phone-shell {
  position: relative;
  width: 100%;
  max-width: var(--app-max);
  height: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow);
}

@media (min-width: 500px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
      radial-gradient(ellipse at 30% 20%, rgba(31, 111, 122, 0.35), transparent 50%),
      radial-gradient(ellipse at 80% 80%, rgba(184, 137, 58, 0.2), transparent 45%),
      #0f1c22;
  }

  .phone-shell {
    height: min(860px, 100dvh - 3rem);
    min-height: 640px;
    border-radius: 32px;
  }
}

.ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(31, 111, 122, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 100%, rgba(184, 137, 58, 0.12), transparent 50%),
    linear-gradient(180deg, #f4f8f9 0%, #e8f0f2 100%);
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Screens */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: screenIn 0.35s ease both;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.screen-home {
  animation-name: fadeIn;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.topbar {
  flex-shrink: 0;
  padding: calc(0.85rem + var(--safe-top)) 1.15rem 0.65rem;
}

.topbar-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 0.5rem;
}

.topbar-center {
  text-align: center;
  min-width: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--teal), var(--teal-deep));
  box-shadow: 0 8px 20px rgba(31, 111, 122, 0.35);
  position: relative;
  flex-shrink: 0;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 11px 12px 11px 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.4));
  clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-tag {
  margin: 0.12rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

.icon-circle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  color: var(--ink);
  font-size: 1.15rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.15s;
}

.icon-circle:active {
  transform: scale(0.96);
}

.icon-circle.danger-soft:active,
.icon-circle.danger-soft:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.screen-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 1.15rem calc(var(--nav-h) + var(--safe-bottom) + 1.25rem);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.search-wrap input,
label input,
label textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* prevent iOS zoom */
  color: var(--ink);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap.tight {
  margin-top: 0.85rem;
}

.search-wrap input:focus,
label input:focus,
label textarea:focus {
  border-color: rgba(31, 111, 122, 0.45);
  box-shadow: 0 0 0 3px rgba(31, 111, 122, 0.12);
}

.section-head {
  margin: 1.1rem 0 0.65rem;
}

.section-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Topic cards */
.topic-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.topic-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(20, 37, 46, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: cardIn 0.35s ease both;
}

.topic-card:active {
  transform: scale(0.985);
}

.topic-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.topic-card-body {
  flex: 1;
  min-width: 0;
}

.topic-card-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.02rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-card-meta {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.topic-card-chevron {
  color: var(--ink-soft);
  opacity: 0.5;
  font-size: 1.1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-soft);
}

.empty-state h2 {
  margin: 0.5rem 0 0.4rem;
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.4rem;
}

.empty-state p {
  margin: 0;
  font-size: 0.95rem;
}

.empty-icon {
  font-size: 2.5rem;
  margin: 0;
}

/* Detail */
.detail-title {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  outline: none;
}

.detail-desc {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  outline: none;
  min-height: 1.35em;
  font-size: 0.95rem;
}

.detail-desc:empty::before {
  content: attr(data-placeholder);
  color: rgba(58, 85, 98, 0.5);
}

.detail-title:focus,
.detail-desc:focus {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 8px;
}

/* Sentences */
.sentence-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sentence-card {
  position: relative;
  padding: 1.05rem 1.1rem 1.05rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(20, 37, 46, 0.04);
  animation: cardIn 0.35s ease both;
}

.sentence-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--teal), var(--gold));
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sentence-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.sentence-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.sentence-actions {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
}

.icon-btn:active {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.icon-btn.danger:active {
  background: var(--danger-soft);
  color: var(--danger);
}

.sentence-meaning {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.sentence-pron {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #6e4f18;
  font-size: 0.84rem;
  font-weight: 600;
  max-width: 100%;
}

.pron-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  flex-shrink: 0;
}

.speak-btn {
  margin-left: 0.1rem;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(184, 137, 58, 0.28);
  color: #6e4f18;
  cursor: pointer;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.speak-btn:active {
  transform: scale(1.08);
}

.empty-sentences {
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed rgba(20, 37, 46, 0.18);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.35);
}

.empty-sentences p {
  margin: 0 0 1rem;
}

/* Bottom nav */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.45rem 1.25rem calc(0.55rem + var(--safe-bottom));
  background: rgba(247, 250, 251, 0.88);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  min-height: var(--nav-h);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-item.active {
  color: var(--teal-deep);
}

.fab-ai.active,
#navTutor.active {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.nav-ico {
  font-size: 1.2rem;
  line-height: 1;
}

.fab {
  width: 58px;
  height: 58px;
  margin-bottom: 0.35rem;
  border: none;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--teal), var(--teal-deep));
  color: #fff;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(31, 111, 122, 0.4);
  display: grid;
  place-items: center;
  transition: transform 0.15s;
}

.fab:active {
  transform: scale(0.94);
}

.fab-ai {
  background: linear-gradient(160deg, #2a8f9a, #1a5c66);
  font-size: 1.35rem;
}

.fab-add {
  position: absolute;
  right: 1.1rem;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 0.75rem);
  z-index: 12;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--teal), var(--teal-deep));
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(31, 111, 122, 0.35);
}

.fab-add.hidden {
  display: none !important;
}

.ai-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2a8f9a, var(--teal-deep));
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 8px 20px rgba(31, 111, 122, 0.3);
}

.tutor-hero,
.tutor-card {
  padding: 0.25rem 0 1rem;
}

.tutor-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

.tutor-hero h2,
.tutor-card .tutor-sentence {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tutor-hero h2 {
  font-size: 1.75rem;
}

.tutor-sentence {
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 0.35rem 0 0.75rem !important;
}

.tutor-sub,
.tutor-note,
.tutor-score {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.ai-bubble {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 0.92rem;
  line-height: 1.45;
  border-left: 3px solid var(--teal);
}

.ai-bubble.small {
  font-size: 0.86rem;
  margin: 0.65rem 0 0;
}

.tutor-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.tutor-stats div {
  text-align: center;
  padding: 0.75rem 0.4rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.tutor-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.tutor-stats span {
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.tutor-progress {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.tutor-progress .bar {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: rgba(20, 37, 46, 0.1);
  overflow: hidden;
}

.tutor-progress .bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: 99px;
}

.teach-block {
  margin: 0.85rem 0;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.teach-block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}

.teach-block p {
  margin: 0;
  font-size: 1.05rem;
}

.teach-block.gold {
  background: var(--gold-soft);
  border-color: transparent;
}

.pron-big {
  font-weight: 700;
  font-size: 1.15rem !important;
  color: #6e4f18;
  letter-spacing: 0.02em;
}

.btn-speak {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--teal-deep);
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.quiz-opt {
  text-align: left;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.quiz-opt:active {
  transform: scale(0.99);
  background: var(--teal-soft);
}

.tutor-feedback {
  margin-top: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.tutor-feedback.ok {
  color: var(--teal-deep);
}

.web-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  vertical-align: middle;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.8rem 1.15rem;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(160deg, var(--teal), var(--teal-deep));
  color: #fff;
  box-shadow: 0 8px 20px rgba(31, 111, 122, 0.28);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-block {
  width: 100%;
}

/* Bottom sheets */
.sheet {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100%;
  width: min(var(--app-max), 100%);
  margin: auto auto 0;
}

.sheet::backdrop {
  background: rgba(20, 37, 46, 0.5);
  backdrop-filter: blur(3px);
}

.sheet-card {
  width: 100%;
  padding: 0.65rem 1.25rem calc(1.25rem + var(--safe-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-bottom: none;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: sheetUp 0.3s ease;
}

@keyframes sheetUp {
  from {
    transform: translateY(40%);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  margin: 0.15rem auto 0.35rem;
  border-radius: 4px;
  background: rgba(20, 37, 46, 0.18);
}

.sheet-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.sheet-card label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.sheet-card textarea {
  resize: vertical;
  min-height: 64px;
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.info-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Install banner */
.install-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 0.75rem);
  transform: translateX(-50%);
  z-index: 30;
  width: min(calc(100% - 2rem), calc(var(--app-max) - 2rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  animation: cardIn 0.4s ease;
}

.install-banner p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.install-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.install-banner .btn-ghost {
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Language chip */
.lang-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.85rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 14px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}

.lang-chip:active {
  transform: scale(0.99);
}

.lang-chip-arrow {
  font-size: 1.2rem;
  opacity: 0.6;
}

/* Settings */
.settings-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.settings-card {
  margin-bottom: 1rem;
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.settings-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.settings-hint {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field-label select,
.sheet-card select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  outline: none;
}

.btn-swap {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0.15rem auto 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  color: var(--teal-deep);
  font-size: 1.2rem;
  cursor: pointer;
}

.settings-saved {
  margin: 0.65rem 0 0;
  text-align: center;
  color: var(--teal-deep);
  font-weight: 600;
  font-size: 0.88rem;
}

.pair-hint {
  margin: -0.35rem 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal);
}

.autofill-status {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.autofill-status.error {
  color: var(--danger);
}

/* First-run language setup overlay */
.lang-setup {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(20, 37, 46, 0.55);
  backdrop-filter: blur(4px);
}

.lang-setup-card {
  width: min(100%, var(--app-max));
  padding: 1.35rem 1.25rem calc(1.35rem + var(--safe-bottom));
  border-radius: 24px 24px 20px 20px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  animation: sheetUp 0.3s ease;
}

.lang-setup-card h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
