:root {
  color-scheme: light;
  --ink: #292521;
  --muted: #77716b;
  --soft-muted: #a09a94;
  --line: #e9e5df;
  --line-strong: #ddd7cf;
  --paper: #ffffff;
  --canvas: #fbfaf7;
  --sidebar: #f5f3ef;
  --accent: #4d443d;
  --accent-hover: #352f2a;
  --warm: #d7a96b;
  --warm-soft: #f2e7d7;
  --success: #5e806a;
  --danger: #b24d4d;
  --shadow: 0 18px 60px rgba(48, 40, 32, 0.09);
  --sidebar-width: 292px;
  --content-width: 780px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #171717;
  --muted: #686868;
  --soft-muted: #999999;
  --line: #ededed;
  --line-strong: #dddddd;
  --paper: #ffffff;
  --canvas: #ffffff;
  --sidebar: #ffffff;
  --accent: #252525;
  --accent-hover: #000000;
  --warm-soft: #f5f5f5;
  --shadow: 0 18px 60px rgba(0, 0, 0, .09);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f5;
  --muted: #a3a3a3;
  --soft-muted: #737373;
  --line: #242424;
  --line-strong: #333333;
  --paper: #000000;
  --canvas: #000000;
  --sidebar: #080808;
  --accent: #eeeeee;
  --accent-hover: #ffffff;
  --warm-soft: #211a13;
  --shadow: 0 18px 60px rgba(0, 0, 0, .62);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.icon-button:hover { background: rgba(50, 45, 40, 0.07); }
.icon { width: 18px; height: 18px; display: block; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Helvetica Neue", Inter, ui-sans-serif, sans-serif;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: .42em;
  text-transform: uppercase;
}

.brand img { width: 34px; height: 34px; border-radius: 23%; object-fit: contain; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }

/* Login */
.login-screen {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(390px, 1.04fr) minmax(460px, .96fr);
  background: var(--paper);
}

.login-story {
  position: relative;
  min-height: 100vh;
  padding: 42px 56px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fffdf8;
  background:
    radial-gradient(circle at 73% 25%, rgba(221, 179, 120, .38), transparent 25%),
    radial-gradient(circle at 15% 88%, rgba(164, 130, 98, .28), transparent 31%),
    linear-gradient(145deg, #282522 0%, #423a34 55%, #665548 100%);
}

.login-story::before,
.login-story::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 50%;
  pointer-events: none;
}

.login-story::before { width: 540px; height: 540px; right: -250px; top: -155px; }
.login-story::after { width: 380px; height: 380px; right: -58px; top: -44px; }
.brand-on-color { position: relative; z-index: 1; color: #f2d49d; }
.brand-on-color,
.mobile-brand {
  gap: 20px;
  font-size: 24px;
}
.brand-on-color img {
  width: 68px;
  height: 68px;
  border: 1px solid rgba(244, 214, 166, .42);
  background: rgba(255, 245, 228, .035);
  box-shadow:
    0 0 0 1px rgba(18, 14, 12, .25),
    0 8px 20px rgba(0, 0, 0, .26),
    0 0 18px rgba(226, 166, 83, .15);
}

.story-copy { position: relative; z-index: 1; max-width: 640px; margin: auto 0; padding: 52px 0; }
.story-copy h1 {
  max-width: 560px;
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 3.15vw, 45px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.story-intro { max-width: 570px; margin: 0; color: rgba(255, 253, 248, .72); font-size: 16px; line-height: 1.62; }
.faith-quote { margin: 27px 0 23px; padding: 4px 0 4px 20px; border-left: 1px solid rgba(227, 189, 134, .62); }
.faith-quote p { margin: 0; color: #fffaf0; font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-weight: 600; line-height: 1.52; }
.faith-quote cite { display: block; margin-top: 11px; color: rgba(242, 212, 157, .68); font-size: 10px; font-style: normal; letter-spacing: .06em; text-transform: uppercase; }
.story-closing { max-width: 575px; margin: 0; color: rgba(255, 253, 248, .68); font-size: 14px; line-height: 1.62; }
.mobile-login-continue { display: none; }

.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 48px; }
.login-card { width: min(100%, 410px); }
.mobile-brand { display: none; }
.login-heading { margin-bottom: 35px; }
.login-heading .eyebrow { color: #9c7242; margin-bottom: 13px; }
.login-heading h2 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 400; letter-spacing: -.025em; }
.login-heading > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: -10px 0 25px; padding: 4px; border-radius: 11px; background: #eeeae5; }
.auth-tabs button { height: 36px; color: #7b746e; border: 0; border-radius: 8px; background: transparent; font-size: 12px; font-weight: 650; cursor: pointer; }
.auth-tabs button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(46, 39, 33, .09); }
.auth-form { display: flex; flex-direction: column; }
.auth-form > label { margin: 18px 0 8px; font-size: 13px; font-weight: 630; }
.auth-form > label:first-child { margin-top: 0; }
.field-wrap { position: relative; }
.field-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 46px 0 43px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field-wrap input:focus { border-color: #8c8178; box-shadow: 0 0 0 3px rgba(77, 68, 61, .08); }
.field-wrap input::placeholder { color: #aaa49e; }
.field-icon { position: absolute; z-index: 1; top: 50%; left: 14px; transform: translateY(-50%); color: #8c857f; pointer-events: none; }
.password-toggle { position: absolute; right: 6px; top: 6px; color: #827a74; }
.password-hint { margin: 7px 2px -6px; color: #99918a; font-size: 10px; line-height: 1.45; }
.form-error { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: 12px; }

.primary-button {
  height: 49px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 10px;
  color: #fff;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(48, 42, 36, .16);
  transition: transform 140ms ease, background 140ms ease;
}
.primary-button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.primary-button:disabled { opacity: .62; cursor: wait; transform: none; }
.text-button { align-self: center; margin-top: 15px; padding: 3px 5px; color: #80603d; border: 0; background: transparent; font-size: 11.5px; font-weight: 620; cursor: pointer; }
.text-button:hover { color: #5f4326; text-decoration: underline; text-underline-offset: 3px; }
.auth-secondary-actions { display: flex; justify-content: center; gap: 16px; }
.auth-secondary-actions .text-button { margin-top: 14px; }
/* Application shell */
.app-shell { height: 100dvh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); overflow: hidden; background: var(--paper); transition: grid-template-columns 200ms ease; }
.app-shell.sidebar-collapsed { --sidebar-width: 0px; }
.sidebar { position: relative; z-index: 20; width: 292px; height: 100dvh; display: flex; flex-direction: column; padding: 17px 13px 13px; border-right: 1px solid var(--line); background: var(--sidebar); transition: transform 200ms ease, opacity 160ms ease, visibility 0s linear; }
.sidebar-top { min-height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 7px; }
.sidebar-top .brand img { width: 31px; height: 31px; }

.sidebar-section { flex: 0 0 auto; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar-today { margin-top: 13px; padding-top: 0; border-top: 0; }
.sidebar-conversations { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.history-label { display: flex; justify-content: space-between; margin: 0 10px 9px; color: #96908a; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.quick-actions { display: grid; gap: 3px; }
.quick-action {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  color: #635c56;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.quick-action:hover { color: #3f3934; background: rgba(255, 255, 255, .7); }
.quick-action > .icon { width: 16px; color: #a07849; }
.quick-action > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.quick-action strong,
.quick-action small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-action strong { font-size: 11.5px; font-weight: 650; }
.quick-action small { color: #9a928b; font-size: 9.5px; }
.conversations-label { min-height: 26px; align-items: center; margin-bottom: 5px; }
.history-actions { display: flex; align-items: center; gap: 1px; }
.history-actions button {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #8e8780;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.history-actions button:hover { color: #514a44; background: rgba(255, 255, 255, .75); }
.history-actions .icon { width: 14px; height: 14px; }
.chat-search-wrap {
  height: 35px;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 25px;
  align-items: center;
  gap: 3px;
  margin: 0 4px 7px;
  padding: 0 4px 0 9px;
  color: #938c85;
  border: 1px solid #ded8d1;
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
}
.chat-search-wrap:focus-within { color: #6c635b; border-color: #bdb4ab; background: #fff; }
.chat-search-wrap > span .icon { width: 14px; height: 14px; }
.chat-search-wrap input { min-width: 0; padding: 0; color: #514b45; border: 0; outline: 0; background: transparent; font-size: 11.5px; }
.chat-search-wrap input::placeholder { color: #a29b95; }
.chat-search-wrap input::-webkit-search-cancel-button { appearance: none; }
.chat-search-wrap button { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; color: #97908a; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.chat-search-wrap button:hover { color: #514a44; background: #f0ece7; }
.chat-search-wrap button .icon { width: 12px; height: 12px; }
.chat-list { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d9d4ce transparent; }
.chat-item { position: relative; display: flex; align-items: center; gap: 1px; min-height: 40px; padding: 0 4px; border-radius: 9px; color: #5e5852; user-select: none; }
.chat-item:hover { background: rgba(255, 255, 255, .65); }
.chat-item.active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(40, 34, 28, .045); }
.chat-select { min-width: 0; min-height: 40px; flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 7px; color: inherit; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.chat-select > .icon { flex: 0 0 auto; width: 15px; height: 15px; color: #948c85; }
.chat-item.pending .chat-select > .icon { color: #9a7244; animation: chat-pulse 1.25s ease-in-out infinite; }
.chat-item-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.chat-more { width: 28px; height: 28px; flex: 0 0 auto; display: none; place-items: center; padding: 0; color: #918983; border: 0; border-radius: 7px; background: transparent; cursor: pointer; appearance: none; }
.chat-item:hover .chat-more, .chat-item.active .chat-more, .chat-more[aria-expanded="true"] { display: grid; }
.chat-more:hover { color: #514a44; background: rgba(255, 255, 255, .78); }
.chat-more .icon { width: 16px; height: 16px; }
.chat-actions-menu { position: absolute; z-index: 55; width: 174px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 13px 38px rgba(35, 29, 24, .18); }
.chat-actions-menu button { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 9px; color: #5a544f; border: 0; border-radius: 8px; background: transparent; font-size: 11.5px; text-align: left; cursor: pointer; }
.chat-actions-menu button:hover { color: #302b27; background: #f4f1ed; }
.chat-actions-menu button .icon { width: 14px; height: 14px; }
.chat-actions-menu .danger-menu-action { color: var(--danger); }
.chat-actions-menu .danger-menu-action:hover { color: #963f3f; background: #fbf2f1; }
.empty-history { padding: 18px 11px; color: #9a938d; font-size: 12px; line-height: 1.5; }
@keyframes chat-pulse { 50% { opacity: .35; } }

.sidebar-footer { position: relative; border-top: 1px solid var(--line); padding-top: 10px; }
.profile-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.profile-button:hover { background: rgba(255, 255, 255, .64); }
.profile-button > .icon { color: #918b85; width: 15px; }
.avatar { width: 30px; height: 30px; display: grid; flex: 0 0 auto; place-items: center; color: #fff; border-radius: 9px; background: #79695e; font-size: 11px; font-weight: 700; }
.profile-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.profile-copy strong, .profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 12px; font-weight: 650; }
.profile-copy small { color: #928c86; font-size: 10px; }
.profile-menu { position: absolute; left: 0; right: 0; bottom: 54px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow); }
.profile-menu button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px; border: 0; border-radius: 8px; color: #5a544f; background: transparent; font-size: 12px; cursor: pointer; }
.profile-menu button:hover { color: #3e3833; background: #f4f1ed; }
.profile-menu #logout-button:hover { color: var(--danger); background: #fbf2f1; }

.sidebar-collapsed .sidebar { transform: translateX(-100%); opacity: 0; visibility: hidden; pointer-events: none; }

.chat-workspace { position: relative; min-width: 0; height: 100dvh; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--paper); }
.chat-header { position: absolute; z-index: 10; inset: 0 0 auto; height: 58px; display: flex; align-items: center; padding: 0 22px; pointer-events: none; }
.chat-header .icon-button { pointer-events: auto; }
.desktop-sidebar-toggle { display: none; flex: 0 0 auto; margin-right: 7px; }
.sidebar-collapsed .desktop-sidebar-toggle { display: inline-grid; }
.header-actions { display: flex; align-items: center; gap: 5px; margin-left: auto; }

.messages { position: relative; overflow-y: auto; scroll-behavior: smooth; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ddd8d1 transparent; }
.message-list { width: min(calc(100% - 48px), var(--content-width)); margin: 0 auto; padding: 78px 0 30px; }
.message { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; margin: 0 0 31px; scroll-margin-bottom: 160px; }
.message-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--accent); font-size: 10px; font-weight: 720; }
.message.user .message-avatar { color: #766a60; border: 1px solid #e5ddd4; background: #f2eae1; }
.message-body { min-width: 0; padding-top: 3px; }
.message-label { margin-bottom: 8px; color: #908983; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.message-content { color: #37322e; font-size: 14px; line-height: 1.78; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: 0 0 13px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 22px 0 9px; color: inherit; line-height: 1.3; }
.markdown-body h1 { font-size: 21px; }
.markdown-body h2 { font-size: 18px; }
.markdown-body h3 { font-size: 15px; }
.markdown-body h4 { font-size: 14px; }
.markdown-body h5, .markdown-body h6 { font-size: 13px; }
.markdown-body ul, .markdown-body ol { margin: 9px 0 14px; padding-left: 23px; }
.markdown-body li { margin: 4px 0; }
.markdown-body .task-list-item { list-style: none; margin-left: -20px; }
.markdown-body .task-list-item input { margin: 0 7px 0 0; accent-color: var(--accent); }
.markdown-body a { color: #7c5c36; text-underline-offset: 3px; }
.markdown-body code { padding: 2px 5px; border-radius: 5px; background: #f1efeb; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.markdown-body pre { margin: 14px 0; padding: 14px 16px; overflow-x: auto; border: 1px solid #45403b; border-radius: 11px; color: #eee9e3; background: #2e2b28; white-space: pre; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.markdown-body blockquote { margin: 14px 0; padding-left: 15px; color: #655e58; border-left: 2px solid #caa574; }
.markdown-body hr { height: 1px; margin: 19px 0; border: 0; background: var(--line); }
.message-table-wrap { max-width: 100%; margin: 14px 0; overflow-x: auto; border: 1px solid #ddd7d0; border-radius: 10px; background: #fff; }
.markdown-body table { width: 100%; min-width: 360px; border-collapse: collapse; font-size: 12.5px; line-height: 1.5; }
.markdown-body th, .markdown-body td { padding: 9px 11px; text-align: left; vertical-align: top; border-bottom: 1px solid #e6e1db; }
.markdown-body th + th, .markdown-body td + td { border-left: 1px solid #e6e1db; }
.markdown-body th { color: #3e3731; background: #f4f0eb; font-weight: 680; }
.markdown-body tbody tr:last-child td { border-bottom: 0; }
.message-actions { display: flex; gap: 2px; margin: 9px 0 0 -7px; opacity: 0; transition: opacity 150ms ease; }
.message:hover .message-actions { opacity: 1; }
.message-action { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 7px; color: #968f88; background: transparent; cursor: pointer; }
.message-action:hover { color: #58514b; background: #f3f1ed; }
.message-action:disabled { opacity: .45; cursor: wait; }
.message-action .icon { width: 14px; height: 14px; }
.message-editor { display: grid; gap: 10px; }
.message-editor textarea {
  width: 100%;
  min-height: 92px;
  max-height: 240px;
  resize: vertical;
  padding: 12px 13px;
  color: #37322e;
  border: 1px solid #cfc8bf;
  border-radius: 12px;
  outline: none;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 6px 20px rgba(45, 38, 31, .05);
}
.message-editor textarea:focus { border-color: #9b8f84; box-shadow: 0 0 0 3px rgba(77, 68, 61, .06); }
.message-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
.message-editor-actions button,
.secondary-button,
.danger-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}
.edit-cancel,
.secondary-button { color: #645d57; border: 1px solid var(--line-strong); background: #fff; }
.edit-submit { color: #fff; border: 1px solid var(--accent); background: var(--accent); }
.message-editor-actions button:disabled { opacity: .55; cursor: wait; }

.activity-slot:empty { display: none; }
.tool-activity { width: fit-content; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: #7d756e; font-size: 11.5px; font-weight: 620; }
.message-content:not(:empty) + .activity-slot .tool-activity { margin: 12px 0 0; }
.activity-spinner { width: 13px; height: 13px; flex: 0 0 auto; border: 1.5px solid #e4d7c7; border-top-color: #9d7445; border-radius: 50%; animation: activity-spin .8s linear infinite; }
@keyframes activity-spin { to { transform: rotate(360deg); } }

.reasoning { margin: 0 0 13px; border-left: 2px solid #dfc39f; }
.reasoning summary { width: fit-content; display: flex; align-items: center; gap: 7px; padding: 3px 0 3px 11px; color: #827970; font-size: 11px; font-weight: 650; cursor: pointer; list-style: none; }
.reasoning summary::-webkit-details-marker { display: none; }
.reasoning summary .icon { transition: transform 150ms ease; }
.reasoning[open] summary .icon { transform: rotate(90deg); }
.reasoning-text { margin: 7px 0 4px; padding: 5px 16px 7px 12px; color: #777069; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.thinking-dots { display: inline-flex; gap: 4px; padding: 7px 0; }
.thinking-dots i { width: 5px; height: 5px; border-radius: 50%; background: #9c9289; animation: pulse 1.2s infinite; }
.thinking-dots i:nth-child(2) { animation-delay: .16s; }
.thinking-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes pulse { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }
.message-error { margin-top: 9px; padding: 10px 12px; color: #9b4343; border: 1px solid #f0d4d1; border-radius: 9px; background: #fcf5f4; font-size: 12px; line-height: 1.5; }
.message-error.stopped { color: #706960; border-color: #ddd7cf; background: #f7f5f2; }

.empty-state { width: min(calc(100% - 48px), 760px); min-height: 100%; display: flex; flex-direction: column; justify-content: center; margin: 0 auto; padding: 0 0 140px; text-align: center; }
.empty-state h1 { margin: 0 0 11px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(21px, 3vw, 29px); font-weight: 400; letter-spacing: -.035em; }
.empty-subtitle { margin: 0; color: var(--muted); font-size: 13px; }

.composer-zone { position: relative; z-index: 9; padding: 11px 22px 13px; background: linear-gradient(to bottom, rgba(255,255,255,.72), #fff 27%); }
.new-chat-view .composer-zone { position: absolute; top: 50%; right: 0; left: 0; transform: translateY(-10px); background: transparent; }
.composer { position: relative; width: min(100%, var(--content-width)); min-height: 91px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "input input input" "mode spacer send"; align-items: end; column-gap: 10px; row-gap: 11px; margin: 0 auto; padding: 12px 10px 10px; border: 1px solid #dcd7d0; border-radius: 17px; background: #fff; box-shadow: 0 8px 28px rgba(45, 38, 31, .07), 0 1px 3px rgba(45, 38, 31, .04); transition: border-color 150ms ease, box-shadow 150ms ease; }
.composer:focus-within { border-color: #aaa097; box-shadow: 0 10px 32px rgba(45, 38, 31, .09), 0 0 0 3px rgba(77, 68, 61, .04); }
.composer textarea { grid-area: input; width: 100%; max-height: 190px; display: block; resize: none; padding: 1px 6px; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 14px; line-height: 1.55; }
.composer textarea::placeholder { color: #aaa39d; }
.mode-switch { grid-area: mode; height: 30px; display: flex; align-items: center; padding: 2px; border: 1px solid #e2ddd6; border-radius: 9px; background: #f4f1ed; }
.mode-switch button { height: 24px; padding: 0 7px; color: #827a73; border: 0; border-radius: 6px; background: transparent; font-size: 10px; font-weight: 520; cursor: pointer; transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease; }
.mode-switch button:hover:not(:disabled) { color: #4f4842; }
.mode-switch button.active { color: #4b4036; background: #fff; box-shadow: 0 1px 4px rgba(45, 38, 31, .1); }
.mode-switch button:disabled { cursor: default; opacity: .58; }
.mode-divider { width: 1px; height: 12px; background: #d7d0c8; }
.send-button { grid-area: send; width: 33px; height: 33px; display: grid; place-items: center; align-self: end; justify-self: end; margin: 0; padding: 0; color: #fff; border: 0; border-radius: 10px; background: var(--accent); line-height: 0; cursor: pointer; appearance: none; -webkit-appearance: none; transition: background 150ms ease, transform 150ms ease; }
.send-button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.send-button.stop-button { background: #625b55; }
.send-button.stop-button:hover { background: #4f4944; }
.send-button.stop-button .icon { width: 14px; height: 14px; }
.send-button:disabled { color: #aaa49e; background: #ebe8e3; cursor: default; transform: none; }
.send-button .icon { width: 16px; height: 16px; }
.disclaimer { margin: 8px auto 0; color: #a19a94; font-size: 9.5px; text-align: center; }
.jump-bottom { position: absolute; z-index: 11; top: -41px; left: 50%; width: 34px; height: 34px; display: grid; place-items: center; margin: 0; padding: 0; transform: translateX(-50%); color: #69615a; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; line-height: 0; box-shadow: 0 5px 18px rgba(40, 34, 29, .12); cursor: pointer; appearance: none; -webkit-appearance: none; }
.jump-bottom .icon { width: 15px; }
.toast-region { position: fixed; z-index: 100; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 340px; padding: 11px 14px; color: #fff; border-radius: 10px; background: #39342f; box-shadow: 0 10px 35px rgba(30, 25, 21, .22); font-size: 12px; animation: toast-in 180ms ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
.mobile-scrim { display: none; }

/* Dialogs */
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(32, 28, 24, .34); backdrop-filter: blur(5px); animation: modal-fade 150ms ease-out; }
.confirm-dialog {
  width: min(100%, 390px);
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 28px 85px rgba(34, 28, 23, .24);
  text-align: center;
  animation: dialog-in 180ms ease-out;
}
.settings-dialog {
  width: min(100%, 570px);
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 19px;
  background: var(--paper);
  box-shadow: 0 28px 85px rgba(34, 28, 23, .24);
  animation: dialog-in 180ms ease-out;
}
.admin-dialog {
  width: min(100%, 1050px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 19px;
  background: var(--paper);
  box-shadow: 0 28px 85px rgba(34, 28, 23, .24);
  animation: dialog-in 180ms ease-out;
}
.admin-heading { align-items: center; }
.admin-heading-actions { display: flex; align-items: center; gap: 8px; }
.admin-month { height: 36px; padding: 0 10px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); font-size: 12px; }
.admin-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.admin-summary > div { display: flex; flex-direction: column; gap: 7px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.admin-summary small { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .055em; text-transform: uppercase; }
.admin-summary strong { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 400; }
.admin-summary.loading { opacity: .55; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.admin-table { width: 100%; min-width: 800px; border-collapse: collapse; font-size: 12px; }
.admin-table th { padding: 11px 12px; color: var(--muted); background: var(--canvas); font-size: 9.5px; font-weight: 700; letter-spacing: .045em; text-align: right; text-transform: uppercase; white-space: nowrap; }
.admin-table th:first-child, .admin-table td:first-child { text-align: left; }
.admin-table th:last-child, .admin-table td:last-child { text-align: center; }
.admin-table td { padding: 13px 12px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.admin-table td:first-child { min-width: 220px; white-space: normal; }
.admin-table td:first-child strong, .admin-table td:first-child small { display: block; }
.admin-table td:first-child strong { overflow-wrap: anywhere; font-size: 12px; font-weight: 650; }
.admin-table td:first-child small { margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.admin-access-button { min-width: 68px; height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); font-size: 10.5px; font-weight: 650; cursor: pointer; }
.admin-access-button.disable { color: var(--danger); }
.admin-access-button.enable { color: var(--success); }
.admin-access-button:disabled { color: var(--muted); opacity: .45; cursor: default; }
.admin-cost-note { margin: 11px 2px 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.word-study-dialog {
  width: min(100%, 470px);
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 19px;
  background: var(--paper);
  box-shadow: 0 28px 85px rgba(34, 28, 23, .24);
  animation: dialog-in 180ms ease-out;
}
.settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.settings-heading .eyebrow { margin-bottom: 7px; color: #9c7242; }
.settings-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 400; letter-spacing: -.025em; }
.word-study-description { margin: 0 0 21px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.word-study-form { display: flex; flex-direction: column; }
.word-study-form > label { margin: 0 0 8px; font-size: 13px; font-weight: 630; }
.word-study-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 9px; margin-top: 5px; }
.word-study-actions .primary-button { height: 40px; margin-top: 0; border-radius: 9px; box-shadow: none; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 22px; padding: 18px 0; border-top: 1px solid var(--line); }
.setting-copy { min-width: 0; display: flex; align-items: flex-start; gap: 12px; }
.setting-copy > .icon { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; color: #9c7242; }
.setting-copy div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.setting-copy strong { font-size: 13px; font-weight: 680; }
.setting-copy small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.segmented-control { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f3f0ec; }
.segmented-control button { min-width: 70px; min-height: 32px; padding: 0 10px; color: #7b746e; border: 0; border-radius: 7px; background: transparent; font-size: 11px; font-weight: 630; cursor: pointer; }
.segmented-control button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 5px rgba(45, 38, 31, .11); }
.settings-done { width: 100%; margin-top: 8px; }
.confirm-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 15px; color: var(--danger); border-radius: 13px; background: #f9ecea; }
.confirm-icon .icon { width: 18px; }
.confirm-dialog h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 400; letter-spacing: -.02em; }
.confirm-dialog p { margin: 10px 0 23px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.danger-button { color: #fff; border: 1px solid #a74848; background: #ad4c4c; }
.danger-button:hover { background: #963f3f; }
.secondary-button:hover { color: #3f3934; border-color: #c9c1b8; background: #faf9f7; }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* White light theme */
html[data-theme="light"] .login-panel,
html[data-theme="light"] .chat-workspace { background: #fff; }
html[data-theme="light"] .auth-tabs,
html[data-theme="light"] .mode-switch,
html[data-theme="light"] .segmented-control { background: #f3f3f3; }
html[data-theme="light"] .auth-tabs button { color: #686868; }
html[data-theme="light"] .auth-tabs button.active,
html[data-theme="light"] .mode-switch button.active,
html[data-theme="light"] .segmented-control button.active { color: #171717; background: #fff; }
html[data-theme="light"] .quick-action { color: #525252; }
html[data-theme="light"] .quick-action:hover,
html[data-theme="light"] .profile-button:hover,
html[data-theme="light"] .chat-item:hover { color: #171717; background: #f6f6f6; }
html[data-theme="light"] .quick-action small,
html[data-theme="light"] .profile-copy small { color: #888; }
html[data-theme="light"] .history-actions button:hover { color: #171717; background: #f4f4f4; }
html[data-theme="light"] .chat-search-wrap { color: #777; border-color: #ddd; background: #fff; }
html[data-theme="light"] .chat-search-wrap:focus-within { color: #171717; border-color: #aaa; background: #fff; }
html[data-theme="light"] .chat-search-wrap input { color: #222; }
html[data-theme="light"] .chat-item { color: #505050; }
html[data-theme="light"] .chat-item.active { color: #171717; background: #f3f3f3; }
html[data-theme="light"] .chat-more:hover { background: #ececec; }
html[data-theme="light"] .profile-menu button:hover,
html[data-theme="light"] .message-action:hover { color: #171717; background: #f3f3f3; }
html[data-theme="light"] .message-content,
html[data-theme="light"] .markdown-body h1,
html[data-theme="light"] .markdown-body h2,
html[data-theme="light"] .markdown-body h3,
html[data-theme="light"] .markdown-body h4,
html[data-theme="light"] .markdown-body h5,
html[data-theme="light"] .markdown-body h6 { color: #222; }
html[data-theme="light"] .message.user .message-avatar { color: #555; border-color: #ddd; background: #f5f5f5; }
html[data-theme="light"] .markdown-body code { background: #f3f3f3; }
html[data-theme="light"] .message-table-wrap { border-color: #ddd; background: #fff; }
html[data-theme="light"] .markdown-body th,
html[data-theme="light"] .markdown-body td { border-color: #ddd; }
html[data-theme="light"] .markdown-body th { color: #222; background: #f5f5f5; }
html[data-theme="light"] .composer-zone { background: linear-gradient(to bottom, rgba(255,255,255,.72), #fff 27%); }
html[data-theme="light"] .new-chat-view .composer-zone { background: transparent; }

/* Black dark theme */
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .chat-workspace { background: var(--paper); }
html[data-theme="dark"] .login-heading .eyebrow,
html[data-theme="dark"] .settings-heading .eyebrow,
html[data-theme="dark"] .setting-copy > .icon { color: #d5ae7d; }
html[data-theme="dark"] .auth-tabs,
html[data-theme="dark"] .mode-switch,
html[data-theme="dark"] .segmented-control { background: #111; }
html[data-theme="dark"] .auth-tabs button { color: #aaa; }
html[data-theme="dark"] .auth-tabs button.active,
html[data-theme="dark"] .mode-switch button.active,
html[data-theme="dark"] .segmented-control button.active { color: #fff; background: #262626; box-shadow: 0 1px 5px rgba(0, 0, 0, .55); }
html[data-theme="dark"] .field-wrap input,
html[data-theme="dark"] .message-editor textarea,
html[data-theme="dark"] .composer,
html[data-theme="dark"] .profile-menu,
html[data-theme="dark"] .confirm-dialog,
html[data-theme="dark"] .chat-actions-menu { color: var(--ink); background: #0d0d0d; }
html[data-theme="dark"] .word-study-dialog { color: var(--ink); background: #0d0d0d; }
html[data-theme="dark"] .field-wrap input::placeholder,
html[data-theme="dark"] .composer textarea::placeholder { color: #737373; }
html[data-theme="dark"] .text-button,
html[data-theme="dark"] .markdown-body a { color: #d5ae7d; }
html[data-theme="dark"] .text-button:hover { color: #efd0a7; }
html[data-theme="dark"] .quick-action { color: #c7c7c7; }
html[data-theme="dark"] .quick-action:hover,
html[data-theme="dark"] .profile-button:hover,
html[data-theme="dark"] .chat-item:hover { color: var(--ink); background: rgba(255, 255, 255, .055); }
html[data-theme="dark"] .quick-action small,
html[data-theme="dark"] .profile-copy small { color: #858585; }
html[data-theme="dark"] .history-actions button:hover { color: var(--ink); background: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .chat-search-wrap { color: #8c8c8c; border-color: var(--line-strong); background: #0d0d0d; }
html[data-theme="dark"] .chat-search-wrap:focus-within { color: var(--ink); border-color: #555; background: #141414; }
html[data-theme="dark"] .chat-search-wrap input { color: var(--ink); }
html[data-theme="dark"] .chat-search-wrap button:hover,
html[data-theme="dark"] .profile-menu button:hover,
html[data-theme="dark"] .message-action:hover { color: var(--ink); background: #1c1c1c; }
html[data-theme="dark"] .chat-item { color: #bdbdbd; }
html[data-theme="dark"] .chat-item.active { color: var(--ink); background: #171717; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .chat-more { color: #a3a3a3; }
html[data-theme="dark"] .chat-more:hover { color: #eee; background: #1c1c1c; }
html[data-theme="dark"] .profile-menu #logout-button:hover { color: #ef8b85; background: #210e0e; }
html[data-theme="dark"] .chat-actions-menu button { color: #ccc; }
html[data-theme="dark"] .chat-actions-menu button:hover { color: #fff; background: #1c1c1c; }
html[data-theme="dark"] .chat-actions-menu .danger-menu-action { color: #ef8b85; }
html[data-theme="dark"] .chat-actions-menu .danger-menu-action:hover { color: #ffaaa4; background: #210e0e; }
html[data-theme="dark"] .message-content,
html[data-theme="dark"] .markdown-body h1,
html[data-theme="dark"] .markdown-body h2,
html[data-theme="dark"] .markdown-body h3,
html[data-theme="dark"] .markdown-body h4,
html[data-theme="dark"] .markdown-body h5,
html[data-theme="dark"] .markdown-body h6 { color: #ededed; }
html[data-theme="dark"] .message.user .message-avatar { color: #ddd; border-color: #333; background: #171717; }
html[data-theme="dark"] .markdown-body code { background: #151515; }
html[data-theme="dark"] .markdown-body blockquote { color: #b5b5b5; }
html[data-theme="dark"] .message-table-wrap { border-color: #333; background: #0d0d0d; }
html[data-theme="dark"] .markdown-body th, html[data-theme="dark"] .markdown-body td { border-color: #303030; }
html[data-theme="dark"] .markdown-body th { color: #eee; background: #171717; }
html[data-theme="dark"] .edit-cancel,
html[data-theme="dark"] .secondary-button { color: #d0d0d0; background: #111; }
html[data-theme="dark"] .message-error { color: #eb8d87; border-color: #451f1f; background: #190b0b; }
html[data-theme="dark"] .message-error.stopped { color: #b5b5b5; border-color: var(--line-strong); background: #111; }
html[data-theme="dark"] .composer-zone { background: linear-gradient(to bottom, rgba(0,0,0,.7), #000 27%); }
html[data-theme="dark"] .new-chat-view .composer-zone { background: transparent; }
html[data-theme="dark"] .send-button { color: #050505; }
html[data-theme="dark"] .primary-button { color: #050505; }
html[data-theme="dark"] .send-button.stop-button { color: #fff; background: #3a3a3a; }
html[data-theme="dark"] .send-button:disabled { color: #666; background: #1b1b1b; }
html[data-theme="dark"] .jump-bottom { color: #d0d0d0; background: #111; }
html[data-theme="dark"] .confirm-dialog,
html[data-theme="dark"] .settings-dialog,
html[data-theme="dark"] .admin-dialog,
html[data-theme="dark"] .word-study-dialog,
html[data-theme="dark"] .chat-actions-menu { border-color: #2b2b2b; box-shadow: 0 28px 85px rgba(0, 0, 0, .75); }
html[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, .72); }

/* Larger interface */
html[data-view-size="large"] { --sidebar-width: 322px; --content-width: 830px; }
html[data-view-size="large"] .icon { width: 21px; height: 21px; }
html[data-view-size="large"] .icon-button { width: 42px; height: 42px; }
html[data-view-size="large"] .sidebar { width: 322px; }
html[data-view-size="large"] .brand { font-size: 14px; }
html[data-view-size="large"] .story-copy h1 { font-size: clamp(32px, 3.5vw, 50px); }
html[data-view-size="large"] .faith-quote p { font-size: 19px; }
html[data-view-size="large"] .faith-quote cite { font-size: 12px; }
html[data-view-size="large"] .story-closing { font-size: 16px; }
html[data-view-size="large"] .login-heading h2 { font-size: 38px; }
html[data-view-size="large"] .login-heading > p:last-child { font-size: 16px; }
html[data-view-size="large"] .auth-tabs button,
html[data-view-size="large"] .auth-form > label,
html[data-view-size="large"] .primary-button { font-size: 15px; }
html[data-view-size="large"] .field-wrap input { height: 54px; font-size: 16px; }
html[data-view-size="large"] .password-hint,
html[data-view-size="large"] .text-button { font-size: 13px; }
html[data-view-size="large"] .sidebar-top .brand img { width: 36px; height: 36px; }
html[data-view-size="large"] .history-label { font-size: 12px; }
html[data-view-size="large"] .quick-action { min-height: 53px; grid-template-columns: 28px minmax(0, 1fr); }
html[data-view-size="large"] .quick-action > .icon { width: 20px; height: 20px; }
html[data-view-size="large"] .quick-action strong { font-size: 14px; }
html[data-view-size="large"] .quick-action small { font-size: 11.5px; }
html[data-view-size="large"] .history-actions button { width: 31px; height: 31px; }
html[data-view-size="large"] .history-actions .icon { width: 18px; height: 18px; }
html[data-view-size="large"] .chat-search-wrap { height: 41px; }
html[data-view-size="large"] .chat-search-wrap input,
html[data-view-size="large"] .chat-item-title,
html[data-view-size="large"] .empty-history { font-size: 14px; }
html[data-view-size="large"] .chat-item { min-height: 47px; }
html[data-view-size="large"] .chat-item > .icon { width: 18px; height: 18px; }
html[data-view-size="large"] .profile-button { min-height: 51px; }
html[data-view-size="large"] .avatar { width: 36px; height: 36px; font-size: 13px; }
html[data-view-size="large"] .profile-copy strong,
html[data-view-size="large"] .profile-menu button { font-size: 14px; }
html[data-view-size="large"] .profile-copy small { font-size: 12px; }
html[data-view-size="large"] .message { grid-template-columns: 34px minmax(0, 1fr); gap: 16px; }
html[data-view-size="large"] .message-avatar { width: 34px; height: 34px; font-size: 12px; }
html[data-view-size="large"] .message-label { font-size: 12px; }
html[data-view-size="large"] .message-content,
html[data-view-size="large"] .message-editor textarea { font-size: 16.5px; }
html[data-view-size="large"] .tool-activity { font-size: 14px; }
html[data-view-size="large"] .activity-spinner { width: 16px; height: 16px; }
html[data-view-size="large"] .reasoning summary { font-size: 13.5px; }
html[data-view-size="large"] .reasoning-text { font-size: 14.5px; }
html[data-view-size="large"] .empty-state h1 { font-size: clamp(26px, 3vw, 34px); }
html[data-view-size="large"] .empty-subtitle { font-size: 15px; }
html[data-view-size="large"] .composer textarea { font-size: 17px; }
html[data-view-size="large"] .mode-switch { height: 36px; }
html[data-view-size="large"] .mode-switch button { height: 30px; padding: 0 10px; font-size: 12.5px; }
html[data-view-size="large"] .send-button { width: 39px; height: 39px; }
html[data-view-size="large"] .send-button .icon { width: 19px; height: 19px; }
html[data-view-size="large"] .disclaimer { font-size: 11px; }
html[data-view-size="large"] .setting-copy strong { font-size: 15px; }
html[data-view-size="large"] .setting-copy small,
html[data-view-size="large"] .segmented-control button { font-size: 13px; }

@media (max-width: 880px) {
  .login-screen { display: block; min-height: 100dvh; }
  .login-story {
    min-height: 100dvh;
    padding: 28px 24px max(28px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .login-story .brand-on-color { flex: 0 0 auto; }
  .story-copy { margin: auto 0; padding: 34px 0 30px; }
  .story-copy h1 { max-width: 350px; }
  .story-intro { font-size: 14px; line-height: 1.58; }
  .faith-quote { margin: 23px 0 20px; padding-left: 16px; }
  .faith-quote p { font-size: 15px; }
  .story-closing { font-size: 13px; line-height: 1.58; }
  .mobile-login-continue {
    min-height: 49px;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #342e29;
    border: 1px solid rgba(255, 250, 240, .55);
    border-radius: 12px;
    background: #f2d49d;
    font-weight: 680;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(15, 12, 10, .22);
  }
  .mobile-login-continue .icon { width: 17px; }
  .login-screen:not(.show-form) .login-panel { display: none; }
  .login-screen.show-form .login-story { display: none; }
  .login-panel { min-height: 100dvh; padding: 30px 24px; background: radial-gradient(circle at 50% 0, #f4eadc, transparent 37%), var(--paper); }
  .mobile-brand { display: flex; align-items: center; margin-bottom: 45px; font-family: "Helvetica Neue", Inter, ui-sans-serif, sans-serif; font-weight: 300; letter-spacing: .42em; text-transform: uppercase; }
  .mobile-brand img {
    width: 72px;
    height: 72px;
    border: 1px solid #cba66f;
    border-radius: 23%;
    object-fit: contain;
    box-shadow: 0 7px 19px rgba(52, 43, 35, .18), 0 0 0 1px rgba(255, 255, 255, .8);
  }

  .app-shell { grid-template-columns: 1fr; }
  .app-shell.sidebar-collapsed { --sidebar-width: 0px; }
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-grid !important; }
  .sidebar, .app-shell.sidebar-collapsed .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 310px); transform: translateX(-102%); opacity: 1; visibility: visible; pointer-events: auto; box-shadow: 18px 0 48px rgba(30, 25, 20, .12); }
  .chat-more { display: grid; }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .mobile-scrim { position: fixed; z-index: 15; inset: 0; display: block; opacity: 0; visibility: hidden; background: rgba(28, 24, 21, .25); backdrop-filter: blur(2px); transition: opacity 180ms ease, visibility 180ms ease; }
  .app-shell.sidebar-open .mobile-scrim { opacity: 1; visibility: visible; }
  .sidebar-footer { padding-top: 6px; }
  .profile-button { gap: 8px; padding: 6px 8px; }
  .profile-button .avatar { width: 20px; height: 20px; border-radius: 6px; font-size: 9px; }
  .profile-copy { gap: 0; }
  .profile-copy strong { line-height: 20px; }
  .profile-copy small { display: none; }
  .profile-menu { bottom: 40px; }
  .chat-header {
    height: 80px;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 13px 0;
    background: linear-gradient(to bottom, var(--paper) 0, var(--paper) 42px, transparent 100%);
    box-shadow: none;
  }
  .message-list, .empty-state { width: min(calc(100% - 30px), var(--content-width)); }
  .message-list { padding-top: 70px; }
  .composer-zone { padding: 9px 10px max(10px, env(safe-area-inset-bottom)); }
  .composer { min-height: 89px; column-gap: 8px; row-gap: 10px; padding: 11px 9px 9px; }
  .disclaimer { font-size: 8.5px; }
  .new-chat-view .composer-zone { padding: 9px 10px max(10px, env(safe-area-inset-bottom)); transform: translateY(-8px); }
  .new-chat-view .empty-state { padding: 0 0 126px; }
  .message-actions { opacity: 1; }
  .modal-backdrop { padding: 12px; place-items: end center; }
  .confirm-dialog { padding: 24px 20px max(24px, env(safe-area-inset-bottom)); border-radius: 19px; }
  .word-study-dialog { padding: 24px 20px max(24px, env(safe-area-inset-bottom)); border-radius: 19px; }
  .settings-dialog { max-height: calc(100dvh - 24px); overflow-y: auto; padding: 24px 20px max(24px, env(safe-area-inset-bottom)); border-radius: 19px; }
  .admin-dialog { max-height: calc(100dvh - 24px); padding: 24px 20px max(24px, env(safe-area-inset-bottom)); border-radius: 19px; }
  html[data-theme="dark"] .login-panel { background: radial-gradient(circle at 50% 0, #181818, transparent 37%), #000; }
  html[data-view-size="large"] .sidebar { width: min(92vw, 350px); }
}

@media (max-width: 520px) {
  .login-panel { place-items: start center; padding-top: 24px; }
  .mobile-brand { margin-bottom: 42px; }
  .login-heading h2 { font-size: 31px; }
  .message { grid-template-columns: 25px minmax(0, 1fr); gap: 10px; }
  .message-avatar { width: 25px; height: 25px; border-radius: 8px; }
  .message-content { font-size: 13.5px; line-height: 1.72; }
  .empty-state h1 { font-size: 22px; }
  .empty-subtitle { font-size: 12px; line-height: 1.5; }
  .setting-row { grid-template-columns: 1fr; gap: 12px; }
  .admin-heading { align-items: flex-start; }
  .admin-heading-actions { align-items: flex-end; flex-direction: column-reverse; }
  .admin-summary { grid-template-columns: 1fr; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; }
  html[data-view-size="large"] .message { grid-template-columns: 31px minmax(0, 1fr); gap: 12px; }
  html[data-view-size="large"] .message-avatar { width: 31px; height: 31px; }
  html[data-view-size="large"] .message-content { font-size: 16px; line-height: 1.75; }
  html[data-view-size="large"] .story-copy h1 { font-size: 32px; }
  html[data-view-size="large"] .faith-quote p { font-size: 17px; }
  html[data-view-size="large"] .story-closing { font-size: 15px; }
  html[data-view-size="large"] .empty-state h1 { font-size: 27px; }
  html[data-view-size="large"] .empty-subtitle { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
