/* Mobile-first, Google Translate style */
:root {
  --blue: #2563eb;
  --blue-light: #e0e7ff;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.04);
  --red-bg: rgba(217, 48, 37, 0.1);
  --red-text: #d93025;
  --amber-bg: rgba(244, 180, 0, 0.1);
  --amber-text: #f29900;
  --green-bg: rgba(24, 128, 56, 0.1);
  --green-text: #188038;
  --blue-bg: rgba(37, 99, 235, 0.15);
}

:root[data-theme="dark"] {
    --blue: #60a5fa;
    --blue-light: #1e3a8a;
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-alt: #334155;
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.5);
    --red-bg: rgba(248, 113, 113, 0.15);
    --red-text: #f87171;
    --amber-bg: rgba(251, 191, 36, 0.15);
    --amber-text: #fbbf24;
    --green-bg: rgba(74, 222, 128, 0.15);
    --green-text: #4ade80;
    --blue-bg: rgba(96, 165, 250, 0.15);
    --blue-text: #60a5fa;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #60a5fa;
    --blue-light: #1e3a8a;
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-alt: #334155;
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.5);
    --red-bg: rgba(248, 113, 113, 0.15);
    --red-text: #f87171;
    --amber-bg: rgba(251, 191, 36, 0.15);
    --amber-text: #fbbf24;
    --green-bg: rgba(74, 222, 128, 0.15);
    --green-text: #4ade80;
    --blue-bg: rgba(96, 165, 250, 0.15);
    --blue-text: #60a5fa;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  overscroll-behavior-y: none;
}

/* Typography & Base */
h1, h2, p { margin: 0 0 16px 0; }
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* Layout */
#app-container {
  overflow: hidden;
  height: calc(100dvh - 56px - env(safe-area-inset-top));
  min-height: calc(100dvh - 56px - env(safe-area-inset-top));
  position: relative;
  display: flex;
  flex-direction: column;
}

.tab-content { display: none; padding: 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); flex: 1; }
.tab-content.active { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }

.hidden { display: none !important; }

/* Translate Tab */
.translate-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  margin-bottom: 16px;
}

.translate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-height: 120px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.card-lang-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.card-text-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card-text-area textarea {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  resize: none;
  outline: none;
  color: var(--text);
  min-height: 60px;
  padding: 0;
}

.card-text-area textarea::placeholder {
  color: #94a3b8;
}

#tgt-text {
  color: var(--text);
}

#save-indicator {
  position: absolute;
  top: 0; right: 0;
  color: var(--green-text);
  font-size: 12px;
  font-weight: bold;
}

.card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
  margin-top: 8px;
}

.icon-btn {
  padding: 8px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover, .icon-btn:active { background: var(--surface-alt); color: var(--text); }
.icon-btn svg,
#btn-speaker-auto svg,
#btn-fc-speaker-auto svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.icon-btn svg[fill="none"],
#btn-speaker-auto svg[fill="none"],
#btn-fc-speaker-auto svg[fill="none"] {
  fill: none !important;
  stroke: currentColor;
}

.bottom-controls {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.lang-selector-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 6px;
  flex: 1;
  max-width: 280px;
  box-sizing: border-box;
  overflow: hidden;
}
.lang-selector-card select {
  border: none;
  background: transparent;
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  height: 100%;
  padding: 0 16px 0 8px;
  text-align: center;
  text-align-last: center;
  -webkit-text-align-last: center;
  -moz-text-align-last: center;
  flex: 1;
  width: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}
.lang-selector-card .icon-btn#btn-swap-lang {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  padding: 0;
  border-radius: 50%;
  background: var(--blue-light);
  box-shadow: none !important;
}
.lang-selector-card .icon-btn#btn-swap-lang svg {
  width: 16px;
  height: 16px;
}

#btn-mic, #btn-speaker-auto {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  flex-shrink: 0 !important;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
}
#btn-mic svg, #btn-speaker-auto svg { width: 28px !important; height: 28px !important; }
#btn-mic.listening {
  color: #fff; background: var(--red-text); border-color: var(--red-text);
  box-shadow: none !important;
  animation: pulse-no-shadow 1.5s infinite;
}
#mic-pill {
  position: absolute;
  top: -30px;
  background: var(--text); color: var(--bg);
  padding: 4px 12px; border-radius: 12px; font-size: 12px;
  white-space: nowrap;
}

#btn-fc-speaker-auto {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
#btn-fc-speaker-auto svg {
  width: 26px !important;
  height: 26px !important;
}

@keyframes pulse-no-shadow {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(0.95); }
}

/* Offline Pill */
/* Tab Bar & Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  padding: 8px 16px;
  height: 56px;
  box-sizing: border-box;
  box-shadow: none !important;
}

.nav-item {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 20px !important;
  border-radius: 9999px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  box-shadow: none !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease;
}
.nav-item svg { width: 22px !important; height: 22px !important; }
.nav-item.active { color: var(--blue); background: var(--blue-light) !important; }

.brand-logo {
  width: 30px !important;
  height: 30px !important;
  object-fit: contain;
  margin: 0;
}

/* Responsive Header */
@media (min-width: 640px) {
  .app-header {
    padding: 0 32px;
    height: 64px;
    justify-content: space-around;
  }
}

/* Saved Tab */
.header-controls { margin-bottom: 16px; }
.header-controls input {
  width: 100%; padding: 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 16px; margin-bottom: 8px; outline: none;
}
.saved-stats { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.csv-actions { display: flex; gap: 8px; }
.csv-actions button {
  flex: 1; padding: 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 500;
}

.list-container { flex: 1; overflow-y: auto; }
.saved-item {
  background: var(--surface); border-radius: 12px; padding: 16px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm); cursor: pointer; display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.saved-item.editing {
  cursor: default;
  border: 1.5px solid var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}
.saved-item.editing .src,
.saved-item.editing .tgt {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--background);
  outline: none;
  margin-right: 0 !important;
  transition: border-color 0.2s, background-color 0.2s;
}
.saved-item.editing .src:focus,
.saved-item.editing .tgt:focus {
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}
.saved-item .src { font-weight: bold; font-size: 16px; }
.saved-item .tgt { color: var(--blue); font-size: 16px; }
.saved-item-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-secondary); }
.saved-item-actions { display: flex; gap: 4px; }
.saved-item-actions .icon-btn { padding: 4px; }
.empty-state { text-align: center; color: var(--text-secondary); padding: 32px 0; font-style: italic; }

/* Flashcards Tab */
.stat-card {
  display: flex; background: var(--surface); border-radius: 12px; padding: 16px;
  box-shadow: var(--shadow-sm); justify-content: space-around; text-align: center; margin-bottom: 24px;
}
.stat-card span { font-size: 24px; font-weight: bold; color: var(--blue); }
.stat-btn {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
  flex: 1;
  min-width: 60px;
}
.stat-btn:hover, .stat-btn:active {
  background: var(--blue-bg);
}
.options-card { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.options-card label { display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.options-card select { padding: 8px; border-radius: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border); }

.primary-btn {
  width: 100%; padding: 14px; background: var(--blue); color: #fff;
  border-radius: 24px; font-size: 16px; font-weight: bold; margin-bottom: 16px;
}

/* FC Session */
.fc-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.progress-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
#fc-progress-fill { height: 100%; background: var(--blue); width: 0%; transition: width 0.3s; }
#fc-progress-text { font-size: 14px; font-weight: bold; width: auto; min-width: 70px; text-align: right; padding-left: 8px; white-space: nowrap; }

.scene { width: 100%; height: 200px; perspective: 1000px; margin-bottom: 24px; }
.card { width: 100%; height: 100%; position: relative; transition: transform 0.6s; transform-style: preserve-3d; cursor: pointer; }
.card.is-flipped { transform: rotateY(180deg); }
.card-face {
  position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center;
}
.card-back { transform: rotateY(180deg); }
.lang-label { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.phrase { font-size: 26px; line-height: 1.3; margin: 16px 0; word-break: break-word; }
.tap-hint { position: absolute; bottom: 16px; font-size: 12px; color: var(--text-secondary); }
.fc-prev-btn { position: absolute; top: 12px; left: 12px; }
.fc-speak-front, .fc-speak-back { position: absolute; top: 12px; right: 12px; }
.fc-edit-btn { position: absolute; bottom: 12px; left: 12px; }
.fc-delete-btn { position: absolute; bottom: 12px; right: 12px; }

#fc-controls-grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grade-btn { padding: 12px 2px; border-radius: 12px; font-weight: bold; display: flex; flex-direction: column; align-items: center; font-size: 13px; cursor: pointer; border: none; }
.grade-btn small { font-weight: normal; margin-top: 4px; font-size: 11px; opacity: 0.8; }
.grade-btn.repeat { background: var(--red-bg); color: var(--red-text); }
.grade-btn.hard { background: var(--amber-bg); color: var(--amber-text); }
.grade-btn.good { background: var(--green-bg); color: var(--green-text); }
.grade-btn.easy { background: var(--blue-bg); color: var(--blue-text); }

/* FC Done */
.done-content { text-align: center; padding: 40px 0; }
.done-content h1 { font-size: 64px; }
#btn-fc-home { width: 100%; padding: 14px; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 24px; font-size: 16px; font-weight: bold; }

/* Account Tab */
input[type="email"], input[type="password"] {
  width: 100%; padding: 14px; margin-bottom: 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 16px; outline: none;
}
#btn-show-signup, #btn-show-login { width: 100%; padding: 14px; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 24px; font-size: 16px; font-weight: bold; margin-bottom: 16px; }
#link-forgot-pwd { display: block; text-align: center; margin-top: 16px; }
.error-msg { color: var(--red-text); font-size: 14px; margin-bottom: 16px; text-align: center; }

.user-info { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding: 16px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-sm); }
#auth-user-email { font-weight: bold; font-size: 16px; word-break: break-all; }
.sync-stats { text-align: center; margin-bottom: 24px; font-size: 24px; font-weight: bold; color: var(--text); }
.sync-stats small { display: block; font-size: 14px; font-weight: normal; color: var(--text-secondary); margin-top: 8px; }
#btn-signout { width: 100%; padding: 14px; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 24px; font-size: 16px; font-weight: bold; }

/* Toast */
#toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 20px; border-radius: 20px;
  font-size: 14px; z-index: 2000; box-shadow: var(--shadow);
  transition: opacity 0.3s;
}
[contenteditable="true"]:focus { outline: none; background: rgba(0,0,0,0.05); border-radius: 4px; padding: 2px 4px; margin: -2px -4px; }

/* Modal Backdrop & Saved Detail Larger Card */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.saved-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface-alt);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.modal-close-btn:hover {
  background: var(--border);
}

.saved-detail-lang-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 12px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.saved-detail-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.saved-detail-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.saved-detail-text-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.saved-detail-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  transition: background 0.2s, border-color 0.2s;
}
.saved-detail-text.tgt {
  color: var(--blue);
  font-size: 20px;
}
.saved-detail-text[contenteditable="true"] {
  background: var(--surface-alt);
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 6px 10px;
  margin: -6px -10px;
  outline: none;
  box-shadow: 0 0 0 3px var(--blue-bg);
}

.saved-detail-example-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  margin-top: 8px;
}

.saved-detail-example-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.saved-detail-example-text {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}
.saved-detail-example-text strong {
  color: var(--blue);
  font-weight: 700;
}

.saved-detail-example-trans {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
}

.saved-detail-example-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.saved-detail-footer {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  justify-content: flex-end;
}

/* Switch toggle */
.switch input:checked + .slider {
  background-color: var(--blue) !important;
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
}
.slider.round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}


/* ---- Review categories ------------------------------------------------- */
.fc-category-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.fc-category-chip:hover { border-color: var(--blue); }
.fc-category-chip:active { transform: scale(0.97); }
.fc-category-chip.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.fc-category-name { font-size: 14px; font-weight: 600; }
.fc-category-count { font-size: 12px; color: var(--text-secondary); }
.fc-category-chip.active .fc-category-count { color: rgba(255, 255, 255, 0.85); }

/* ---- Saved list multi-selection ---------------------------------------- */
.saved-item.selected {
  background: var(--blue-bg, rgba(26, 115, 232, 0.12));
  box-shadow: inset 0 0 0 1px var(--blue);
}
#btn-delete-selected:not(:disabled):hover { background: rgba(255, 255, 255, 0.18); }
#btn-delete-selected:disabled { cursor: default; }

/* ---- Category chips in the phrase details dialog ----------------------- */
.detail-category-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--blue-bg, rgba(26, 115, 232, 0.12));
  white-space: nowrap;
}

/* ---- Login gate --------------------------------------------------------- */
#login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
#login-gate.hidden { display: none; }
.login-gate-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  padding: 36px 28px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.login-gate-logo { width: 64px; height: 64px; margin-bottom: 14px; }
.login-gate-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.login-gate-tagline { color: var(--text-secondary); font-size: 14px; margin-bottom: 26px; }
.login-gate-spinner {
  width: 28px;
  height: 28px;
  margin: 8px auto;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  animation: login-gate-spin 0.8s linear infinite;
}
#login-gate:not(.checking) .login-gate-spinner { display: none; }
@keyframes login-gate-spin { to { transform: rotate(360deg); } }
