* {
  box-sizing: border-box;
}
:root {
  --bg: #1e1f22;
  --bg-deep: #222428;
  --surface: #2d2e32;
  --elevated: #3b3c40;
  --border: #4b4c52;
  --border-strong: #5b5c63;
  --text: #e1e2e5;
  --muted: #9ea3ac;
  --faint: #6e7278;
  --green: #04aa6d;
  --green-tint: rgba(4, 170, 109, 0.14);
  --scroll: #5b5c63;
  --scroll-hover: #6e6f76;
}
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll) var(--bg);
  scrollbar-gutter: stable;
  overflow-y: scroll;
  background: var(--bg);
}
body {
  background: var(--bg);
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-hover);
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}
a {
  color: #93c5fd;
}
body {
  font-family: "Noto Serif", serif;
  font-size: 15px;
  line-height: 1.6;
}
header,
header nav,
header nav a,
h1,
h2,
h3,
h4,
h5,
h6,
.brand {
  font-family: Montserrat, sans-serif;
}
code,
kbd,
pre,
samp {
  font-family: "JetBrains Mono", monospace;
}
.topbar {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(45, 46, 50, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  padding-top: env(safe-area-inset-top);
}
.topbar-row > :first-child {
  justify-self: start;
}
.topbar-row nav {
  grid-column: 2;
  justify-self: center;
}
.topbar-row .auth-area {
  justify-self: end;
  min-width: 0;
}
.layout,
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}
.brand {
  font-weight: 700;
  font-size: 1.25rem;
}
.brand img {
  width: 28px;
  height: 28px;
  border-radius: 0;
  object-fit: cover;
  display: block;
  flex: none;
}
.disclaimer {
  padding: 8px 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
}
.disclaimer a {
  color: #93c5fd;
  text-decoration: none;
}
.disclaimer a:hover {
  text-decoration: underline;
}
.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 760px);
  gap: 16px;
  padding: 16px;
  justify-content: center;
  min-height: calc(100vh - 140px);
  min-height: calc(100dvh - 140px);
}
.selector {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px;
  align-self: start;
  position: sticky;
  top: 60px;
}
.select-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
  display: block;
}
.disciple-select {
  width: 100%;
  margin: 6px 0 4px;
  height: 44px;
  min-height: 44px;
  padding: 0 48px 0 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 12px;
  line-height: 44px;
  outline: none;
}
.disciple-select:focus {
  border-color: #3b82f6;
  outline: none;
}
.disciple-select:hover {
  border-color: var(--border-strong);
}
.history-box {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.history-list {
  max-height: 180px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}
.history-item {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-del {
  flex: none;
  min-width: 44px;
  min-height: 36px;
  padding: 2px 6px;
}
.chat-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  overflow: hidden;
}
.voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--elevated), var(--surface));
}
.voice-title {
  min-width: 0;
}
.voice-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.voice-auth .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.voice-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.voice-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.chat-log {
  flex: 1;
  overflow: auto;
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}
.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 0;
  line-height: 1.5;
  font-size: 0.93rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
  border-radius: 0;
}
.bubble.assistant {
  align-self: flex-start;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
}
.sources {
  margin-top: 8px;
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--faint);
}
.citation-bar {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  min-height: 28px;
  color: var(--muted);
  font-size: 0.78rem;
  background: var(--surface);
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.resources {
  margin-top: 8px;
  padding: 8px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 0;
}
.chat-form {
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px;
  transition: border-color 0.15s;
}
.composer:focus-within {
  border-color: #3b82f6;
}
.composer textarea {
  flex: 1;
  min-height: 24px;
  max-height: 120px;
  padding: 6px 6px;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  resize: none;
  overflow-y: auto;
  line-height: 1.5;
  font-family: inherit;
  font-size: 16px;
}
.composer-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.composer .btn.icon {
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}
.composer .btn.icon.send {
  min-width: 44px;
  font-size: 1rem;
  line-height: 1;
}
.chat-form textarea:disabled {
  opacity: 0.6;
}
.btn {
  padding: 8px 14px;
  min-height: 44px;
  border-radius: 0;
  border: 1px solid var(--border);
  background: var(--elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 0.86rem;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.12s ease,
    background-color 0.15s ease,
    opacity 0.15s ease;
}
.btn:not(:disabled):active {
  transform: scale(0.97);
}
.btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.btn.primary:hover {
  background: #1d4ed8;
}
.btn.small {
  padding: 5px 10px;
  font-size: 0.82rem;
  min-height: 36px;
  min-width: 36px;
}
.btn.active {
  border-color: #3b82f6;
  background: #1e3a5f;
  color: #dbeafe;
}
.bubble.streaming {
  opacity: 0.95;
}
.bubble.streaming .bubble-text::after {
  content: " ▌";
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn[hidden] {
  display: none !important;
}
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 100;
  max-width: min(480px, 90vw);
}
.toast {
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.5;
  padding: 10px 16px;
  text-align: center;
  opacity: 1;
  transition: opacity 0.3s;
}
.toast.hide {
  opacity: 0;
}
.auth-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 290px;
  min-height: 36px;
  flex: none;
}
#btnSignIn,
#btnSignOut {
  width: 150px;
  flex: none;
}
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 24px;
  padding: 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  margin-bottom: 0;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms;
}
.footer-links a:hover {
  color: var(--text);
}
.footer-links span {
  color: var(--faint);
}
.footer-note {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;
  text-align: center;
  font-size: 11px;
  line-height: 20px;
  color: var(--faint);
}
.foot-tabs,
.foot-legal {
  display: none;
}
.muted {
  color: var(--muted);
}
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    max-width: 760px;
  }
  .selector {
    position: static;
  }
  .bubble {
    max-width: 85%;
  }
  .chat-panel {
    min-height: 0;
    max-height: none;
  }
  .chat-log {
    overflow: visible;
  }
  .chat-form {
    position: sticky;
    bottom: 0;
    z-index: 5;
  }
}
@media (max-width: 560px) {
  .chat-log {
    padding: 12px;
  }
  .disclaimer {
    font-size: 0.74rem;
  }
}
@media (max-width: 640px) {
  .topbar {
    padding-top: env(safe-area-inset-top);
  }
  .topbar-row {
    height: 56px;
    padding: 0 16px;
    gap: 8px;
    grid-template-columns: auto 1fr auto;
  }
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
  }
  .nav-toggle:hover {
    background: var(--elevated);
  }
  .topbar-row nav {
    position: static;
  }
  .nav-links {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    background: rgba(45, 46, 50, 0.98);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px;
    gap: 4px;
    max-width: none;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    overflow: visible;
    scrollbar-width: auto;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
  }
  .brand {
    font-size: 0.95rem;
    white-space: nowrap;
  }
  .auth-area {
    min-width: 0;
    gap: 6px;
  }
  #btnSignIn,
  #btnSignOut {
    width: auto;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .chip {
    min-height: 44px;
  }
  .footer-inner {
    flex-direction: column;
    gap: 8px;
    padding-bottom: calc(28px + 64px);
  }
  .footer-links,
  .footer-inner > span {
    display: none;
  }
  .foot-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    gap: 4px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    z-index: 40;
  }
  .foot-tabs a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px;
    min-height: 56px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
  }
  .foot-tabs a.active {
    color: #38bdf8;
  }
  .foot-legal {
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--faint);
  }
  .foot-legal a {
    color: var(--muted);
    text-decoration: none;
  }
  .foot-legal .dot {
    margin: 0 6px;
    color: var(--faint);
  }
  .home-fab {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .layout,
  .pricing,
  .wrap {
    padding-bottom: 88px;
  }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
}
.nav-toggle:hover {
  background: var(--elevated);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
}
.nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: 0;
  object-fit: cover;
  display: block;
}
.home-fab {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--muted);
  text-decoration: none;
  z-index: 40;
}
.home-fab:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.home-fab img {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-family: Montserrat, sans-serif;
  padding: 8px 16px;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--elevated);
}
@supports (text-wrap: pretty) {
  body {
    text-wrap: pretty;
  }
}
.topbar-row nav a {
  font-family: Montserrat, sans-serif;
}
html {
  overscroll-behavior: none;
}
body {
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
.topbar,
.foot-tabs,
.chat-form {
  user-select: none;
  -webkit-user-select: none;
}
.chat-log,
.bubble,
textarea,
input {
  user-select: text;
  -webkit-user-select: text;
}
@media (display-mode: standalone) {
  .topbar {
    padding-top: env(safe-area-inset-top);
  }
  .chat-form {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
.faq,
.pricing-faq {
  max-width: 760px;
  margin: 40px auto 0;
  display: grid;
  gap: 12px;
  border: none;
  background: transparent;
}
.pricing-faq h2 {
  font-family: Montserrat, sans-serif;
  font-size: 1.4rem;
  line-height: 1.3;
  margin: 0;
  text-align: center;
}
.faq details,
.pricing-faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 20px 24px;
}
.faq summary,
.pricing-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker,
.pricing-faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after,
.pricing-faq summary::after {
  content: "+";
  color: var(--faint);
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  width: 16px;
  text-align: center;
  flex: none;
}
.faq details[open] summary::after,
.pricing-faq details[open] summary::after {
  content: "–";
  font-size: 18px;
  line-height: 1;
  width: 16px;
  text-align: center;
}
.faq p,
.pricing-faq p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin: 12px 0 0;
}
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 40px 0 8px;
  flex-wrap: wrap;
}
.blog-pagination button {
  min-width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}
.blog-pagination button:hover {
  border-color: var(--green);
  color: var(--green);
}
.blog-pagination button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  cursor: default;
}
.blog-pagination button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
main {
  animation: page-fade-in 0.32s ease-out both;
}
@keyframes page-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  main {
    animation: none;
  }
}
