:root {
  --bg: #ffffff;
  --text-main: #0d0d0d;
  --text-muted: #737373;
  --text-subtle: #9ca3af;
  --border-light: #ebebeb;
  --border-field: #e5e5e5;
  --btn-black: #0d0d0d;
  --btn-hover: #262626;
  --btn-disabled: #f0f0f0;
  --btn-disabled-text: #a8a8a8;
  --accent-blue: #2563eb;
  --accent-amber: #d97706;
  --accent-amber-bg: #fffbeb;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--text-main);
  outline-offset: 3px;
}

/* Page Container */
.page {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.6px;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wordmark-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: #f4f4f4;
  color: #525252;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 2px 5px;
}

.header-nav {
  display: flex;
  gap: 4px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.icon-button:hover {
  background: #f7f7f8;
  color: var(--text-main);
  border-color: #dcdcdc;
}

/* Main Content Area */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.view {
  width: 100%;
}

/* Typography & Section Intros */
.intro-block {
  text-align: center;
  margin-bottom: 28px;
}

.brand-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f7f7f8;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

.intro-block h1 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.6px;
  margin: 0 0 8px;
  color: var(--text-main);
}

.intro-block p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Form Fields */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-main);
  margin-bottom: 8px;
}

input[type="text"], input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border-field);
  border-radius: 12px;
  background: #fafafa;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: all 0.15s;
}

input[type="text"]:focus, input[type="password"]:focus {
  background: #fff;
  border-color: var(--text-main);
  box-shadow: 0 0 0 1px var(--text-main);
}

input::placeholder {
  color: var(--text-subtle);
  font-size: 13px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 48px;
}

.eye-button {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.eye-button:hover {
  color: var(--text-main);
}

/* Privacy Note */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 24px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
  background: #fafafa;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
}

.privacy-note svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #525252;
}

/* Buttons */
.primary-btn {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 9999px;
  background: var(--btn-black);
  color: #fff;
  font-size: 14px;
  font-weight: 550;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s, transform 0.05s;
}

.primary-btn:hover:not(:disabled) {
  background: var(--btn-hover);
}

.primary-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.primary-btn:disabled {
  background: var(--btn-disabled);
  color: var(--btn-disabled-text);
}

.ghost-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  padding: 12px 0;
  text-align: center;
  transition: color 0.15s;
  display: block;
}

.ghost-btn:hover {
  color: var(--text-main);
}

.ghost-btn.danger {
  color: #dc2626;
  margin-top: 4px;
}

/* User Strip */
.user-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-light);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-main);
  font-weight: 500;
  transition: all 0.15s;
}

.account-chip:hover {
  background: #f7f7f8;
  border-color: #d4d4d4;
}

.user-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.account-chip svg {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
}

.dest-badge {
  font-size: 11px;
  color: var(--text-muted);
}

/* Card */
.card {
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.card-actions {
  display: flex;
  gap: 6px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}

.action-btn svg {
  width: 13px;
  height: 13px;
}

.action-btn:hover:not(:disabled) {
  background: #f7f7f8;
  color: var(--text-main);
  border-color: #d4d4d4;
}

.action-btn:disabled {
  opacity: 0.45;
}

.ocr-btn {
  color: #171717;
}

.ocr-btn.working svg {
  animation: spin 1s linear infinite;
}

/* Captcha Display Stage */
.captcha-stage {
  height: 66px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: #fafafa;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  overflow: hidden;
}

.captcha-stage img {
  width: 180px;
  max-height: 54px;
  object-fit: contain;
}

.captcha-stage span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Code Row & Digits */
.code-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  position: relative;
  margin-bottom: 12px;
}

.digit {
  height: 54px;
  border: 1px solid var(--border-field);
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 550;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  transition: all 0.15s;
}

.digit.active {
  border-color: var(--text-main);
  box-shadow: 0 0 0 1px var(--text-main);
}

.digit.active:empty:after {
  content: "";
  width: 1px;
  height: 18px;
  background: var(--text-main);
  animation: blink 1.1s infinite;
}

.digit.filled {
  background: #fafafa;
}

.digit.ai {
  color: var(--accent-blue);
  background: #eff6ff;
  border-color: #bfdbfe;
}

.digit.uncertain {
  color: var(--accent-amber);
  background: var(--accent-amber-bg);
  border-color: #fde68a;
  box-shadow: 0 0 0 2px #fef3c7;
}

.digit.editing {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px var(--border-light);
  background: #f4f4f5;
}

.code-row input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  caret-color: transparent;
}

/* Entry Options & Checkboxes */
.entry-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  gap: 10px;
  padding-top: 4px;
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.toggle-option input {
  accent-color: var(--btn-black);
  width: 13px;
  height: 13px;
  margin: 0;
}

.attempts-text {
  font-variant-numeric: tabular-nums;
  color: var(--text-subtle);
  font-size: 10px;
}

/* Status Message */
.message {
  min-height: 38px;
  padding: 6px 2px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.message.error {
  color: #dc2626;
}

.message.success {
  color: #059669;
}

.inline-message {
  font-size: 12px;
  color: #dc2626;
  margin-bottom: 12px;
}

.inline-message:empty {
  display: none;
}

/* Numeric Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.keypad button {
  height: 54px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: #fff;
  color: var(--text-main);
  font-size: 25px;
  font-weight: 450;
  transition: background 0.1s, transform 0.05s;
}

.keypad button:hover:not(:disabled) {
  background: #f7f7f8;
}

.keypad button:active:not(:disabled) {
  background: #ebebeb;
  transform: scale(0.98);
}

.keypad button:disabled {
  color: var(--btn-disabled-text);
  border-color: #f5f5f5;
}

.keypad .key-action {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
}

.footer-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-meta a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-meta a:hover {
  color: var(--text-main);
}

.footer-note {
  font-size: 10px;
  color: var(--text-subtle);
  margin: 6px 0 0;
}

/* Modal Dialogs */
.modal {
  border: 1px solid var(--border-light);
  border-radius: 20px;
  width: calc(100% - 40px);
  max-width: 360px;
  padding: 24px;
  background: #fff;
  color: var(--text-main);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal h2 {
  font-size: 18px;
  font-weight: 650;
  margin: 0 0 10px;
}

.modal p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 20px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.danger-btn {
  background: #dc2626;
}

.danger-btn:hover:not(:disabled) {
  background: #b91c1c;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

/* Keyframes */
@keyframes blink {
  50% { opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Small Screens Adjustments */
@media (max-height: 720px) {
  .page {
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .header {
    margin-bottom: 12px;
  }
  .captcha-stage {
    height: 54px;
    margin-bottom: 10px;
  }
  .captcha-stage img {
    max-height: 44px;
  }
  .digit {
    height: 46px;
    font-size: 22px;
  }
  .keypad button {
    height: 46px;
    font-size: 22px;
  }
  .primary-btn {
    height: 46px;
  }
  .card {
    padding: 14px;
  }
}

/* Restore the earlier minimal underline form layout. */
.welcome{font-size:22px;font-weight:500;letter-spacing:.2px;margin-bottom:28px}.welcome-note{margin:7px auto 0;max-width:270px;color:#858585;font-size:12px;font-weight:400;line-height:1.6}.field{margin-bottom:27px}.field label{display:block;font-size:13px;font-weight:500;margin:0;padding:0}input[type=text],input[type=password]{height:52px;padding:0 2px;border:0;border-bottom:1px solid #d4d4d4;border-radius:0;background:#fff;font-size:16px;box-shadow:none}input[type=text]:focus,input[type=password]:focus{background:#fff;border:0;border-bottom:1px solid #171717;box-shadow:0 1px 0 #171717}.password-wrap input{padding-right:44px}.eye{right:0;top:6px;background:#fff}

/* Compact credential form styled like the supplied sign-in reference. */
#setup-view .intro-block .brand-pill{display:none}#setup-view .field{margin-bottom:14px}#setup-view .field label{display:block;margin:0 0 7px 1px;padding:0;font-size:13px;font-weight:500;color:#171717}#setup-view input[type=text],#setup-view input[type=password]{height:46px;padding:0 16px;border:0;border-radius:999px;background:#f0f1f2;font-size:14px;box-shadow:none}#setup-view input[type=text]:focus,#setup-view input[type=password]:focus{background:#f0f1f2;border:0;box-shadow:0 0 0 2px #d9dadd}#setup-view .password-wrap input{padding-right:48px}#setup-view .eye-button{right:6px;top:5px;width:36px;height:36px}.privacy-note{display:none}

#setup-view,#settings-form,#settings-form .field,#settings-form label,#settings-form input{pointer-events:auto}#settings-form input{position:relative;z-index:1;user-select:text;-webkit-user-select:text;touch-action:manipulation}#settings-form .password-wrap{position:relative}

#setup-view .intro-block p{max-width:260px;margin-left:auto;margin-right:auto;padding-left:10px;padding-right:10px}

/* White terminal presentation with sequential typed status lines. */
#login-view{background:#fff;color:#171717;border:0;border-radius:0;padding:0;font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono","Microsoft JhengHei",monospace;box-shadow:none}
.terminal-bar{display:flex;align-items:center;gap:12px;font-size:11px;color:#777;border-bottom:1px solid #e8e8e8;padding-bottom:12px;margin-bottom:16px}.terminal-lights{display:none}#terminal-auth-status{margin-left:auto;color:#777}

#login-view .keypad, #login-view #code-row, #login-view #code, #login-view .challenge-card, #login-view .entry-options, #login-view input[type=checkbox], #login-view .action-line, #login-view .terminal-actions, #login-view #continue, #login-view #retry-handoff, #login-view .message-line, #login-view #message, #login-view .message, .legacy-compat, .legacy-compat * { display: none !important; }

.terminal-line{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:1.7;color:#171717;min-height:22px}
.terminal-line .term-prompt{color:#71717a;font-weight:600;min-width:10px;line-height:1.7}
.terminal-pending{visibility:hidden}
.terminal-typing:after{content:"";display:inline-block;width:.67em;height:.67em;margin-left:.25em;border-radius:50%;background:#171717;vertical-align:middle;animation:terminal-cursor .8s steps(1) infinite}
#login-view.terminal-intro-running .result-line,#login-view.terminal-intro-running .conf-line,#login-view.terminal-intro-running .message-line,#login-view.terminal-intro-running .action-line,#login-view.terminal-intro-running .action-line-status{visibility:hidden;pointer-events:none}
@keyframes terminal-cursor{50%{opacity:0}}
@media(prefers-reduced-motion:reduce){.terminal-typing:after{animation:none}}

#login-view .terminal-captcha{margin:4px 0}
#login-view .terminal-captcha .captcha-stage{display:flex;align-items:center;justify-content:flex-start;height:auto;min-height:50px;background:#fff;border:0;border-radius:0;margin:4px 0;padding-left:18px;position:relative;overflow:hidden;max-width:216px}
#login-view .terminal-captcha .captcha-stage img{max-width:100%;width:180px;object-fit:contain;cursor:pointer}

.scan-preview .captcha-stage:after{content:"";position:absolute;left:18px;right:0;top:0;height:2px;background:#171717;box-shadow:0 0 10px rgba(0,0,0,0.35);animation:captcha-preview-sweep 1s ease-in-out infinite alternate}
.captcha-preview-line{color:#71717a;font-size:12px}
@keyframes captcha-preview-sweep{from{top:4px}to{top:calc(100% - 4px)}}
@media(prefers-reduced-motion:reduce){.scan-preview .captcha-stage:after{animation:none;display:none}}

.result-line #terminal-code-val{font-weight:700;letter-spacing:2px}
.conf-line{color:#171717;font-weight:400}
.conf-line.uncertain{color:#71717a;font-weight:400}
.action-line-status{color:#171717;font-weight:500}
.message-line{color:#52525b;font-size:12px}
.message.success{color:#171717 !important}

#terminal-log-stream{display:flex;flex-direction:column;gap:3px;margin-top:6px}
#terminal-log-stream .terminal-line{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:1.7;color:#171717;min-height:22px}
#terminal-log-stream .term-prompt{color:#71717a;font-weight:600;min-width:10px;line-height:1.7}
#terminal-log-stream .term-content{color:#171717;word-break:break-word}
#terminal-log-stream .terminal-line.dim .term-content{color:#71717a}
#login-view.terminal-intro-running #terminal-log-stream{visibility:hidden}



/* How it works */
.flow{list-style:none;margin:0 auto 28px;padding:0;max-width:300px;display:flex;flex-direction:column;gap:22px;position:relative}
.flow:before{content:"";position:absolute;left:11px;top:12px;bottom:12px;width:1px;background:var(--border-light)}
.flow li{display:flex;align-items:flex-start;gap:14px;position:relative}
.flow-dot{flex:none;width:23px;height:23px;border-radius:50%;background:var(--btn-black);color:#fff;font-size:11px;font-weight:600;display:grid;place-items:center}
.flow li div{display:flex;flex-direction:column;gap:3px;padding-top:2px}
.flow strong{font-size:14px;font-weight:600}
.flow li div span{font-size:12px;color:var(--text-muted);line-height:1.5}

/* Admin statistics */
.admin .content{justify-content:flex-start}
.admin .header{margin-bottom:32px}
.admin-tag{font-size:12px;color:var(--text-muted)}
#admin-login{margin:auto 0}
.stat-heroes{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:12px;margin-bottom:32px}
.stat-hero{display:flex;flex-direction:column;gap:4px;min-width:0}
.stat-label{font-size:12px;color:var(--text-muted)}
.stat-hero strong{font-size:24px;font-weight:650;letter-spacing:-1.5px;font-variant-numeric:tabular-nums;line-height:1.1}
.stat-block{margin-bottom:32px;position:relative}
.stat-block h2{font-size:13px;font-weight:600;margin:0 0 14px}
.bars{display:flex;align-items:flex-end;height:120px;border-bottom:1px solid var(--border-light)}
.bar-hit{flex:1;height:100%;display:flex;align-items:flex-end;justify-content:center;padding:0 1px;cursor:default}
.bar{width:100%;max-width:10px;background:var(--btn-black);border-radius:4px 4px 0 0;transition:opacity .15s}
.bar.empty{background:var(--border-light);border-radius:0}
.bars:hover .bar-hit:not(.active) .bar:not(.empty){opacity:.35}
.bars-axis{display:flex;justify-content:space-between;font-size:10px;color:var(--text-subtle);margin-top:6px}
.bar-tip{position:absolute;top:22px;transform:translateX(-50%);background:var(--btn-black);color:#fff;font-size:11px;padding:4px 8px;border-radius:6px;white-space:nowrap;pointer-events:none;font-variant-numeric:tabular-nums}
.stat-table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}
.stat-table th{font-size:11px;font-weight:500;color:var(--text-muted);text-align:left;padding:0 0 8px;border-bottom:1px solid var(--border-light)}
.stat-table td{padding:10px 0;border-bottom:1px solid var(--border-light)}
.stat-table th:nth-child(n+4),.stat-table td:nth-child(n+4){text-align:right}
.stat-heroes .stat-hero:first-child strong{font-size:40px}
.empty-row{color:var(--text-muted);text-align:center !important}
.stat-note{font-size:11px;color:var(--text-subtle);margin:8px 0 0}

/* Terms */
.text-link{border:0;background:none;padding:0;font:inherit;color:inherit;text-decoration:underline;text-underline-offset:2px}
.text-link:hover{color:var(--text-main)}
.consent{margin:12px 0 0;text-align:center;font-size:11px;color:var(--text-muted)}
.content:has(#terms-view:not([hidden])){justify-content:flex-start}
.doc{margin:0 0 20px}
.doc h2{font-size:14px;font-weight:600;margin:22px 0 8px}
.doc p,.doc li{font-size:13px;line-height:1.7;color:#404040;margin:0}
.doc ul{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px}
.doc strong{color:var(--text-main);font-weight:600}

/* Home: outlined start button, terminal rises beneath the greeting */
.outline-btn{background:#fff;color:var(--text-main);border:1px solid var(--text-main)}
.outline-btn:hover:not(:disabled){background:#f7f7f8}
.content:has(#home-view:not([hidden])){justify-content:flex-start;padding-top:22vh}
#home-view .intro-block{margin-bottom:32px}
#login-view.below-home{animation:terminal-rise .45s cubic-bezier(.2,.8,.2,1) both}
@keyframes terminal-rise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#login-view.below-home{animation:none}}
@media(max-height:720px){.content:has(#home-view:not([hidden])){padding-top:12vh}}

/* Login progress on the terminal divider */
#login-view .terminal-bar{border-bottom:0;margin-bottom:0}
.term-progress{height:2px;background:#e8e8e8;margin:0 0 16px;overflow:hidden;border-radius:2px}
.term-progress i{display:block;height:100%;width:0;background:var(--text-main);border-radius:2px;transition:width .6s cubic-bezier(.2,.8,.2,1),background .2s}
.term-progress.working i{background-image:linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent);background-size:60px 100%;background-repeat:no-repeat;animation:progress-sheen 1.2s linear infinite}
.term-progress.failed i{background:#a3a3a3;animation:none}
@keyframes progress-sheen{from{background-position:-60px 0}to{background-position:calc(100% + 60px) 0}}
@media(prefers-reduced-motion:reduce){.term-progress i{transition:none}.term-progress.working i{animation:none}}

/* CAPTCHA scan: a soft band sweeping left to right */
.scan-preview .captcha-stage:after{left:18px;right:auto;top:0;bottom:0;width:32px;height:auto;background:linear-gradient(90deg,transparent,rgba(23,23,23,.14));border-right:2px solid #171717;box-shadow:none;animation:captcha-scan-x 1.1s cubic-bezier(.45,0,.55,1) infinite}
@keyframes captcha-scan-x{from{left:-14px}to{left:100%}}

/* Terminal: fixed to the remaining screen height, scrolls inside, no visible scrollbar */
.page:has(#login-view.below-home:not([hidden])){height:100dvh;min-height:0;overflow:hidden}
.page:has(#login-view.below-home:not([hidden])) .content{min-height:0}
#login-view.below-home{flex:1;min-height:0;display:flex;flex-direction:column}
#login-view.below-home .terminal-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:12px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 18px);mask-image:linear-gradient(to bottom,transparent 0,#000 18px);padding-top:6px}
#login-view.below-home .terminal-body::-webkit-scrollbar{display:none}

/* When the terminal opens, the greeting glides up to give it room */
.content:has(#home-view:not([hidden])){transition:padding-top .55s cubic-bezier(.2,.8,.2,1)}
.content:has(#login-view.below-home:not([hidden])){padding-top:3vh}
#home-view .intro-block{transition:margin-bottom .55s cubic-bezier(.2,.8,.2,1)}
.content:has(#login-view.below-home:not([hidden])) #home-view .intro-block{margin-bottom:20px}
@media(prefers-reduced-motion:reduce){.content:has(#home-view:not([hidden])),#home-view .intro-block{transition:none}}

.wordmark{align-items:baseline}
.wordmark-sub{font-size:12px;font-weight:500;letter-spacing:.2px;color:var(--text-subtle)}
.wordmark{align-items:center}
.wordmark-sub{font-size:10px;font-weight:600;letter-spacing:.6px;color:var(--text-muted);border:1px solid var(--border-field);border-radius:6px;padding:2px 6px;line-height:1.2}

/* Greeting typing: ghost text reserves the final width so the centered title never shifts */
.intro-block h1.greet{display:table;position:relative;margin:0 auto 8px;white-space:nowrap}
#greet-ghost{visibility:hidden}
.greet-typed{position:absolute;left:0;top:0}

/* Install page */
.install-now{max-width:260px;margin:0 auto 26px}
.install-guides{display:flex;flex-direction:column;gap:26px;margin-bottom:24px}
.install-guides.android-first{flex-direction:column-reverse}
.guide h2{font-size:12px;font-weight:600;color:var(--text-muted);margin:0 auto 14px;max-width:300px}
.guide .flow{margin-bottom:0}
.tips{list-style:none;margin:0 auto 20px;padding:14px 16px;max-width:300px;background:#fafafa;border:1px solid var(--border-light);border-radius:12px;display:flex;flex-direction:column;gap:8px}
.tips li{font-size:12px;line-height:1.6;color:var(--text-muted);padding-left:12px;position:relative}
.tips li:before{content:"";position:absolute;left:0;top:.7em;width:4px;height:4px;border-radius:50%;background:#a3a3a3}
.content:has(#install-view:not([hidden])){justify-content:flex-start}
