:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f0f5ff;
  --text: #12172a;
  --muted: #667085;
  --line: #d9e2f2;
  --brand: #24c7e8;
  --brand-2: #5947e7;
  --danger: #d92d20;
  --success: #039855;
  --warning: #b54708;
  --shadow: 0 20px 55px rgba(18, 23, 42, 0.10);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(36,199,232,.14), transparent 38%), var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; flex-shrink: 0; }
/* codex_2026_04_15 Preserve the logo's native aspect ratio so it does not appear stretched in the header. */
/* codex_2026_04_15 The max-width guard keeps the mark readable without letting it overrun the nav on narrow screens. */
.logo img { display: block; height: 78px; width: auto; max-width: min(420px, 56vw); object-fit: contain; object-position: left center; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-actions form { margin: 0; }
.nav-notification-menu { position: relative; }
.nav-notification-menu summary { list-style: none; }
.nav-notification-menu summary::-webkit-details-marker { display: none; }
.nav-notification-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 700; }
.nav-notification-bell { font-size: 1rem; line-height: 1; }
.nav-notification-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: #1d4ed8; color: #fff; font-size: .78rem; font-weight: 800; }
/* codex_2026_05_12 Keep the bell preview server-rendered so authenticated users can see their latest unread items without any extra client-side fetch or unsafe DOM work. */
/* codex_2026_05_12 The dropdown reuses the card palette so it feels native to the rest of the app instead of a browser-default popover. */
.nav-notification-dropdown { position: absolute; right: 0; top: calc(100% + 10px); width: min(360px, 86vw); padding: 16px; border-radius: 22px; background: rgba(255,255,255,.98); border: 1px solid var(--line); box-shadow: 0 26px 70px rgba(18, 23, 42, 0.18); display: none; z-index: 30; }
.nav-notification-menu[open] .nav-notification-dropdown { display: block; }
.nav-notification-dropdown-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.nav-notification-dropdown-head strong { font-size: .94rem; }
.nav-notification-dropdown-head a { color: #3154c9; font-size: .88rem; font-weight: 700; }
.nav-notification-empty { margin: 0; color: var(--muted); font-size: .92rem; }
.nav-notification-item { margin: 0; }
.nav-notification-item + .nav-notification-item { margin-top: 8px; }
.nav-notification-item-button { width: 100%; border: 1px solid #d9e6ff; border-radius: 18px; background: #f8fbff; padding: 12px 14px; text-align: left; cursor: pointer; display: grid; gap: 4px; font: inherit; color: inherit; }
.nav-notification-item-button:hover { border-color: #bfd5ff; background: #eef5ff; }
.nav-notification-item-title { font-size: .92rem; font-weight: 800; line-height: 1.25; }
.nav-notification-item-message { color: #4f628a; font-size: .87rem; line-height: 1.35; }
.nav-notification-item-time { color: var(--muted); font-size: .8rem; }
/* codex_2026_04_15 The injected auth buttons live inside a span, so this turns that span into a flex row with explicit spacing. */
/* codex_2026_04_15 A slightly larger gap keeps Login and Sign up from visually merging in the header. */
[data-auth-area] { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.container { max-width: 1180px; margin: 0 auto; padding: 34px 22px 70px; }
.hero {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 26px;
  align-items: stretch;
  margin-bottom: 24px;
}
.card, .hero-card, .panel {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card { padding: 34px; }
.hero-card h1 { font-size: clamp(2.1rem, 4vw, 4rem); line-height: 1.05; margin: 0 0 16px; letter-spacing: -0.04em; }
.hero-card p { color: var(--muted); font-size: 1.08rem; margin: 0 0 22px; }
.hero-eyebrow { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px; background: #eef5ff; color: #3154c9; font-size: .8rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; margin-bottom: 16px; }
.hero-proof { max-width: 52ch; font-size: 1rem; color: #40527a; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
/* codex_2026_05_05 Surface the core member benefits as inline proof points so the homepage converts better before the visitor scrolls. */
/* codex_2026_05_05 The pill treatment keeps them readable without competing with the primary call-to-action buttons. */
.hero-benefits { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.hero-benefit { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.88); border: 1px solid #d7e6ff; color: #23325f; font-size: .88rem; font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.stat { background: var(--surface-2); border-radius: 18px; padding: 15px; }
.stat strong { display: block; font-size: 1.45rem; }
.stat span { color: var(--muted); font-size: .9rem; }
.side-card { padding: 26px; }
.landing-side-proof { margin-top: 18px; padding: 16px; border-radius: 18px; background: #f8fbff; border: 1px solid #d9eaff; }
.landing-side-proof strong { display: block; margin-bottom: 10px; }
.landing-side-list { margin: 0; padding-left: 18px; color: #40527a; }
.landing-side-list li { margin-bottom: 8px; }
.landing-side-list li:last-child { margin-bottom: 0; }
.landing-side-cta { margin-top: 18px; width: 100%; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 17px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 10px 25px rgba(89,71,231,.22); }
.btn-secondary { background: #edf4ff; color: #23325f; }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: #fff1f0; color: var(--danger); border: 1px solid #ffd0cc; }
.btn-small { padding: 8px 12px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.search-panel { padding: 18px; margin-bottom: 22px; }
.search-row, .form-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  padding: 13px 15px;
  font: inherit;
}
textarea { min-height: 150px; resize: vertical; }
label { font-weight: 750; display: block; margin: 16px 0 8px; }
.help { color: var(--muted); font-size: .92rem; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.question-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; min-height: 235px; }
.question-card h2, .question-card h3 { margin: 0; line-height: 1.25; }
.question-card p { color: var(--muted); margin: 0; }
.meta { display: flex; gap: 10px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: #eff6ff; color: #2552a3; border: 1px solid #d9eaff; padding: 5px 10px; border-radius: 999px; font-size: .84rem; font-weight: 700; }
.tag.ai { background: #f4f3ff; color: #53389e; border-color: #dedcff; }
.question-origin-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #fff7e6; color: #9a5b00; border: 1px solid #ffe1ad; font-size: .82rem; font-weight: 800; }
.status { margin-left: auto; font-weight: 800; }
.status.answered { color: var(--success); }
.status.open { color: var(--warning); }

.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-title h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1.1; }
.page-title p { margin: 8px 0 0; color: var(--muted); }
.question-origin-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; color: #6a5a2c; }
/* codex_2026_05_05 Add a conversion-focused content band below the hero so the homepage explains value before asking guests to commit. */
/* codex_2026_05_05 These sections intentionally reuse the current card system to keep the landing page aligned with the rest of the app. */
.landing-value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0 0 24px; }
.landing-value-card { padding: 24px; }
.landing-value-card h2 { margin: 10px 0 10px; font-size: 1.35rem; line-height: 1.18; }
.landing-value-card p { margin: 0; color: var(--muted); }
.landing-value-kicker { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: #eef5ff; color: #3154c9; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.landing-bottom-cta { margin-top: 24px; padding: 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, rgba(36,199,232,.12), rgba(89,71,231,.08)); }
.landing-bottom-cta h2 { margin: 10px 0 10px; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.1; }
.landing-bottom-cta p { margin: 0; color: #40527a; max-width: 60ch; }
.landing-bottom-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.answer { padding: 22px; margin-bottom: 18px; }
.answer-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; margin-bottom: 12px; }
.bot-link { font-weight: 850; color: #3154c9; }
.vote-box { display: flex; align-items: center; gap: 8px; }
.vote-box button { border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; background: #fff; cursor: pointer; }
.comment { margin: 12px 0 0 22px; padding: 12px 15px; background: #f8fbff; border-left: 3px solid var(--brand); border-radius: 12px; color: var(--muted); }
.notification-card { padding: 22px; margin-top: 18px; }
.notification-card-unread { border-color: #b9d5ff; box-shadow: 0 22px 60px rgba(36, 79, 201, 0.12); }
.notification-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.notification-card-head h2 { margin: 0 0 6px; font-size: 1.2rem; }
.notification-card-head p { margin: 0; color: var(--muted); }
.notification-status { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: #eef5ff; color: #3154c9; font-size: .8rem; font-weight: 800; }
/* codex_2026_05_12 Notification rows now include a small POST form for unread items, so zero the default form margin to keep the action aligned with the timestamp. */
/* codex_2026_05_12 This keeps the unread and already-read rows visually identical even though one uses a button and the other uses a link. */
.notification-card .meta form { margin: 0; }

.profile-layout { display: grid; grid-template-columns: 310px 1fr; gap: 20px; }
.profile-card { padding: 24px; position: sticky; top: 90px; align-self: start; }
.avatar { width: 74px; height: 74px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display:inline-flex; align-items:center; justify-content:center; color:#fff; font-weight:900; font-size:1.5rem; overflow:hidden; position:relative; flex: 0 0 auto; line-height: 1; isolation: isolate; }
/* codex_2026_04_25 Use a dedicated inner wrapper so uploaded avatars are clipped by a fixed circular box instead of the outer flex button. */
/* codex_2026_04_25 This avoids rectangular source images escaping when browser layout treats the outer avatar as content-sized. */
.avatar-media { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: block; flex: 0 0 auto; }
.avatar-media img { width: 100%; height: 100%; min-width: 100%; min-height: 100%; max-width: none; object-fit: cover; object-position: center; display: block; }
.avatar-has-image { background: #e8eefc; }
.header-avatar { width:34px; height:34px; min-width:34px; min-height:34px; flex-basis: 34px; font-size:.8rem; }
/* codex_2026_04_30 Give bots a different silhouette and badge so they never read like human profile images in shared UI surfaces. */
/* codex_2026_04_30 The square-ish radius plus AI chip works even when the bot has no uploaded image and falls back to initials. */
.bot-avatar { border-radius: 22px; background: linear-gradient(135deg, #123b7a, #22b4da); border: 1px solid #cfe0ff; overflow: visible; }
.bot-avatar .avatar-media,
.bot-avatar-media { border-radius: 22px; }
.bot-avatar-badge { position: absolute; right: -6px; bottom: -6px; display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: #ffffff; color: #1d4ed8; border: 1px solid #cfe0ff; font-size: .72rem; font-weight: 900; box-shadow: 0 10px 20px rgba(17, 24, 39, 0.12); z-index: 2; }
.bot-avatar-badge-small { min-width: 24px; height: 24px; padding: 0 7px; font-size: .64rem; right: -5px; bottom: -5px; }
.bot-avatar-small { width: 56px; height: 56px; min-width: 56px; min-height: 56px; flex-basis: 56px; font-size: 1.1rem; }
.bot-identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.bot-card .bot-identity { display: grid; grid-template-columns: auto minmax(280px, 1fr); align-items: start; width: 100%; }
.bot-identity-inline { gap: 14px; }
.bot-identity-meta { min-width: 0; }
.bot-card .bot-identity-meta { grid-column: 1 / -1; }
.bot-identity-meta h3 { margin: 0 0 4px; }
.bot-identity-meta p { margin: 0; color: var(--muted); }
.bot-identity-meta .meta { margin-top: 2px; }
/* codex_2026_06_01 Keep picture-upload controls in the identity header so owners edit the image beside its current preview. */
/* codex_2026_06_01 The compact max width avoids making the header read like a separate full-width form section. */
.bot-header-picture-tools { max-width: 620px; min-width: 0; }
.bot-header-picture-tools strong { display: block; margin: 0 0 6px; }
.bot-header-picture-tools .help { margin-bottom: 6px; }
.bot-avatar-upload-status { min-height: 1.2em; font-weight: 800; color: #3154c9; }
.bot-profile-hero { display: flex; align-items: center; gap: 22px; min-width: 0; }
.bot-profile-hero-copy { min-width: 0; }
.bot-profile-hero-copy h1 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3.2rem); }
.bot-profile-hero-copy p { margin: 0 0 16px; color: var(--muted); max-width: 720px; }
.bot-profile-avatar { width: 84px; height: 84px; min-width: 84px; min-height: 84px; flex-basis: 84px; font-size: 1.6rem; }
.bot-avatar-upload-row { display: flex; align-items: center; gap: 12px; margin-bottom: 0; flex-wrap: wrap; }
/* codex_2026_06_06 The visible label replaces iOS Safari's unreliable native file-input chrome while preserving the real input for uploads. */
.bot-avatar-upload-button { width: fit-content; }
.empty-state-card { display: flex; flex-direction: column; justify-content: center; min-height: 180px; }
.empty-state-card h3 { margin-bottom: 8px; }
.empty-state-card p { margin: 0; color: var(--muted); }
.profile-fields { margin-top: 18px; display: grid; gap: 12px; }
.field { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.field span { display:block; color: var(--muted); font-size:.86rem; }
.field strong { display:block; margin-top:3px; }
.tabs { display:flex; gap:10px; flex-wrap:wrap; margin-bottom: 16px; }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
/* codex_2026_04_16 Style the knowledge-source guidance as a visible but non-blocking banner above the private bot list. */
/* codex_2026_04_16 The highlighted folder token helps users spot the exact local directory name without exposing anything publicly. */
.knowledge-note { margin-bottom: 18px; padding: 22px; background: linear-gradient(135deg, rgba(36,199,232,.12), rgba(89,71,231,.08)); border: 1px solid #cfe0ff; border-radius: 22px; box-shadow: var(--shadow); }
.knowledge-note h3 { margin: 0 0 12px; font-size: 1.25rem; }
.knowledge-note p { margin: 0 0 12px; color: #23325f; }
.knowledge-note p:last-child { margin-bottom: 0; }
.knowledge-folder { color: #1d4ed8; font-weight: 800; }
.bot-card { padding: 20px; margin-bottom: 16px; }
.bot-card-onboarding { border-color: #b9d5ff; box-shadow: 0 22px 60px rgba(36, 79, 201, 0.14); }
/* codex_2026_05_31 Break registered-bot cards into named sections so dense setup, profile, budget, and key text remains visible but easier to scan. */
/* codex_2026_05_31 Borders and compact headings create hierarchy without hiding any owner-facing instructions. */
.bot-card-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.bot-card-section:first-of-type { margin-top: 0; }
.bot-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bot-section-title strong { color: #18233f; font-size: .96rem; }
.bot-section-title span { color: var(--muted); font-size: .84rem; font-weight: 800; }
.bot-card-section label { margin-top: 10px; }
.bot-card-section .help { margin-top: 0; }
/* codex_2026_06_01 Use equal detail columns so the name and profile-picture controls read as a balanced pair instead of a wide/narrow split. */
/* codex_2026_06_01 The upload row keeps its button aligned without letting the file input stretch the whole card unevenly. */
.bot-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; align-items: start; }
.bot-field-full { grid-column: 1 / -1; }
/* codex_2026_04_28 Keep the first-run bot guidance visually distinct so the user understands connection is still pending. */
/* codex_2026_04_28 The banner stays inside the private bot card so the CTA remains attached to the exact bot that was just created. */
.bot-onboarding { margin-bottom: 14px; padding: 18px; background: linear-gradient(135deg, rgba(36,199,232,.16), rgba(89,71,231,.10)); border: 1px solid #c8dafd; border-radius: 18px; }
.bot-onboarding-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bot-onboarding strong { font-size: 1rem; }
.bot-onboarding p { margin: 0; color: #23325f; }
.bot-onboarding-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 6px 10px; background: #eef4ff; color: #23408f; font-size: .8rem; font-weight: 800; border: 1px solid #cfe0ff; }
.bot-onboarding-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.bot-onboarding-actions .help { margin: 0; }
.bot-connection-status { margin: 0 0 14px; color: #245f45; font-weight: 700; }
/* codex_2026_04_29 Keep the public bot-profile URL close to the bot heading so owners can share it without confusing it with private API-key controls. */
/* codex_2026_04_29 The row stays flexible because real public URLs are long and should remain readable without horizontal layout breakage. */
.public-link-row { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.public-link-box { flex: 1; margin-top: 0; word-break: break-all; }
.public-link-button { flex-shrink: 0; }
/* codex_2026_05_31 Present answer/comment budgets as paired numeric controls so owners can compare the daily write caps at a glance. */
/* codex_2026_05_31 Fixed min widths keep the fields usable on desktop while allowing a clean single-column stack on mobile. */
.bot-quota-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 14px; margin-top: 6px; }
/* codex_2026_04_16 Align the API key with its regenerate action so rotation controls sit beside the secret they affect. */
/* codex_2026_04_16 The key container remains flexible to preserve long tokens without breaking the dashboard layout. */
.api-key-row { display: flex; align-items: center; gap: 14px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; background:#0f172a; color:#e2e8f0; border-radius:14px; padding:14px; overflow:auto; }
.api-key-row .secret { flex: 1; }
.api-key-copy-button { flex-shrink: 0; }
.api-key-button { flex-shrink: 0; }
/* codex_2026_04_16 Keep the join text and its copy action aligned horizontally so the dashboard reads as one compact action block. */
/* codex_2026_04_16 The flexible text column preserves long API keys without pushing the button below on desktop widths. */
.copy-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.copy-text { background:#f8fbff; border:1px dashed #aecbff; border-radius:14px; padding:14px; margin-top:12px; }
.copy-row .copy-text { flex: 1; margin-top: 0; }
.copy-row-button { flex-shrink: 0; }
/* codex_2026_04_29 Keep pending-bot join text available to the clipboard handler without rendering a second visible instruction block. */
/* codex_2026_04_29 The hidden utility avoids unsafe DOM duplication while preserving screen-reader access to the server-rendered text node. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.auth-box { max-width: 520px; margin: 35px auto; padding: 30px; }
/* codex_2026_04_18 Group social sign-up actions into a compact stack so alternate auth options feel native to the existing form. */
/* codex_2026_04_18 The buttons stay visually distinct while preserving the same rounded language as the rest of the site. */
.social-auth { display: grid; gap: 12px; margin: 20px 0 18px; }
.btn-social { width: 100%; justify-content: flex-start; padding: 14px 18px; border: 1px solid var(--line); box-shadow: none; }
.btn-google { background: #ffffff; color: #1f2937; }
.btn-facebook { background: #1877f2; color: #ffffff; }
.social-auth-mark { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
.btn-google .social-auth-mark { background: #f3f4f6; color: #db4437; }
.btn-facebook .social-auth-mark { background: rgba(255,255,255,.16); color: #ffffff; font-family: Georgia, serif; font-size: 1.15rem; }
/* codex_2026_04_18 Use a labeled divider so the fallback email flow is clearly separated from Google and Facebook options. */
.auth-divider { position: relative; text-align: center; margin: 8px 0 20px; color: var(--muted); font-size: .92rem; }
.auth-divider::before { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1px solid var(--line); }
.auth-divider span { position: relative; background: rgba(255,255,255,.94); padding: 0 12px; }
/* codex_2026_04_16 Keep the current avatar visible near the upload field so profile-image changes have immediate context. */
/* codex_2026_04_16 The larger avatar size makes the static HTML prototype read like a real profile settings page. */
.profile-photo-preview { display:flex; align-items:center; gap:18px; padding:18px; background:#f8fbff; border:1px solid var(--line); border-radius:20px; margin: 10px 0 24px; }
.profile-photo-avatar { width: 92px; height: 92px; min-width: 92px; min-height: 92px; flex-basis: 92px; font-size: 2rem; flex-shrink: 0; }
.profile-photo-meta { flex: 1; }
.profile-photo-meta strong { display:block; font-size: 1rem; margin-bottom: 4px; }
.profile-photo-meta .help { margin: 0; }
/* codex_2026_04_16 Group the profile-picture upload inside the preview card so the edit affordance stays attached to the avatar. */
/* codex_2026_04_16 The upload control spans the card width to keep the settings form visually balanced. */
.profile-photo-upload { margin-top: 16px; }
.profile-photo-label { display: block; margin: 0 0 8px; font-weight: 750; }
.profile-photo-input { width: 100%; }
.form-inline-link { display: flex; justify-content: flex-end; margin-top: 10px; }
.form-inline-link a { color: #3154c9; font-weight: 700; }
.form-actions { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-top:20px; flex-wrap:wrap; }
.notice { border-radius: 18px; padding: 14px 16px; background:#ecfdf3; color:#027a48; border:1px solid #abefc6; margin: 14px 0; }
.warning { background:#fffaeb; color:#b54708; border-color:#fedf89; }
.form-error { margin: 10px 0 0; color: var(--danger); font-size: .92rem; font-weight: 700; }
.confirm-modal-open { overflow: hidden; }
/* codex_2026_05_05 Present destructive confirmations in a focused overlay so the user can pause and read the consequence before submitting. */
/* codex_2026_05_05 The layout stays intentionally compact because delete actions need clarity more than extra surrounding interface chrome. */
.confirm-modal-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(18, 23, 42, 0.46); backdrop-filter: blur(8px); }
.confirm-modal-overlay[hidden] { display: none; }
.confirm-modal { width: min(100%, 460px); padding: 26px; border-radius: 24px; background: rgba(255,255,255,.98); border: 1px solid #dbe7f7; box-shadow: 0 28px 70px rgba(18, 23, 42, 0.22); }
.confirm-modal-title { margin: 0 0 10px; font-size: clamp(1.35rem, 2.8vw, 1.8rem); line-height: 1.1; letter-spacing: -.03em; }
.confirm-modal-body { margin: 0; color: #526481; font-size: .98rem; }
.confirm-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
/* codex_2026_05_14 Turn the footer into a trust surface with visible legal and support links required for AWS and OAuth reviews. */
/* codex_2026_05_14 The compact stacked layout keeps the links readable on mobile without overpowering the product content above. */
.footer { border-top:1px solid var(--line); padding:24px 22px; color:var(--muted); text-align:center; display:grid; gap:10px; }
.footer-nav { display:flex; align-items:center; justify-content:center; gap:18px; flex-wrap:wrap; font-weight:700; color:#3154c9; }
.footer-copy { font-size:.92rem; }

/* codex_2026_05_14 Give static policy pages the same card and spacing language as the rest of the app so they feel intentional rather than bolted on. */
/* codex_2026_05_14 The section borders break dense legal copy into reviewable chunks without needing any client-side navigation widgets. */
.content-page-card { padding: 28px; }
.content-page-header { margin-bottom: 20px; max-width: 72ch; }
.content-page-header h1 { margin: 10px 0 10px; font-size: clamp(1.9rem, 3vw, 2.8rem); line-height: 1.08; }
.content-page-header p { margin: 0; color: var(--muted); }
.content-page-stack { display: grid; gap: 18px; }
.content-page-section { padding-top: 18px; border-top: 1px solid var(--line); }
.content-page-section:first-child { padding-top: 0; border-top: 0; }
.content-page-section h2 { margin: 0 0 8px; font-size: 1.08rem; }
.content-page-section p { margin: 0; color: #40527a; max-width: 74ch; }
.content-page-section a { color: #3154c9; font-weight: 700; }
/* codex_2026_04_30 Turn the ask-question page into a guided composition surface so the user gets writing help without leaving the form. */
/* codex_2026_04_30 The layout stays server-rendered and static, which improves clarity without adding new client-side input behavior. */
.ask-form { padding: 30px; }
.ask-form-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 18px; align-items: stretch; margin-bottom: 22px; }
.ask-form-hero-copy { padding: 26px; border-radius: 22px; background: linear-gradient(135deg, rgba(36,199,232,.14), rgba(89,71,231,.08)); border: 1px solid #cfe0ff; }
.ask-form-eyebrow { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: #eef5ff; color: #3154c9; font-size: .78rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.ask-form-hero-copy h2 { margin: 14px 0 10px; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.08; letter-spacing: -.03em; }
.ask-form-hero-copy p { margin: 0; color: #40527a; font-size: 1rem; max-width: 58ch; }
.ask-form-hero-note { padding: 24px; border-radius: 22px; background: #f8fbff; border: 1px solid #d9eaff; }
.ask-form-hero-note strong { display: block; margin-bottom: 10px; font-size: 1rem; }
.ask-form-tip-list,
.ask-form-checklist,
.ask-form-side-list { margin: 0; padding-left: 20px; color: #40527a; }
.ask-form-tip-list li,
.ask-form-checklist li,
.ask-form-side-list li { margin-bottom: 8px; }
.ask-form-tip-list li:last-child,
.ask-form-checklist li:last-child,
.ask-form-side-list li:last-child { margin-bottom: 0; }
.ask-form-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 20px; align-items: start; }
.ask-form-main,
.ask-form-sidebar { display: grid; gap: 18px; }
.ask-form-section,
.ask-form-sidecard { padding: 24px; border-radius: 22px; background: #fbfdff; border: 1px solid #dbe7f7; }
.ask-form-section label { margin-top: 0; }
.ask-form-section .help { margin: 0 0 12px; }
.ask-form-section textarea { min-height: 220px; }
.ask-form-section [aria-invalid="true"] { border-color: #f3a6a0; box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.08); }
.ask-form-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.ask-form-count { font-weight: 800; color: #3154c9; }
.ask-form-feedback { flex: 1; min-width: 240px; }
.ask-form-prompt-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
/* codex_2026_05_05 Keep the existing question image and its remove control in one card so edit decisions stay attached to the preview they affect. */
/* codex_2026_05_05 The compact split layout prevents the preview from dominating the form while still giving enough visual context. */
.ask-current-image { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 16px; padding: 16px; border-radius: 18px; background: #f8fbff; border: 1px solid #d9eaff; margin-bottom: 14px; align-items: start; }
.ask-current-image-media img { display: block; width: 100%; max-height: 220px; object-fit: contain; border-radius: 14px; background: #ffffff; }
.ask-current-image-copy strong { display: block; margin-bottom: 6px; font-size: 1rem; }
.ask-current-image-copy .help { margin-bottom: 12px; }
.ask-current-image-toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: #23325f; }
.ask-current-image-toggle input { margin: 0; }
/* codex_2026_05_04 Keep the ask-question image preview compact and contained so screenshots help with confidence without overwhelming the form. */
/* codex_2026_05_04 The preview uses a neutral frame because the real content, not the chrome, should hold visual attention. */
.ask-image-preview { margin-top: 14px; padding: 14px; border-radius: 18px; background: #f8fbff; border: 1px solid #d9eaff; }
.ask-image-preview img { display: block; width: 100%; max-height: 300px; object-fit: contain; border-radius: 14px; background: #ffffff; }
/* codex_2026_05_04 Style the writing-prompt chips as active helpers so the description field feels scaffolded without looking like a toolbar. */
/* codex_2026_05_04 The shared pill shape keeps them visually aligned with the tag chips while giving them a distinct neutral tone. */
.ask-prompt-chip { background: #ffffff; color: #23325f; border-color: #cfe0ff; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.ask-prompt-chip:hover,
.ask-prompt-chip:focus-visible { transform: translateY(-1px); border-color: #8fb4ff; box-shadow: 0 8px 18px rgba(49, 84, 201, 0.12); outline: none; }
.ask-form-examples { display: grid; gap: 10px; margin-top: 12px; }
.ask-form-context-tags { padding: 14px 16px; border-radius: 18px; background: #f8fbff; border: 1px dashed #cfe0ff; }
.ask-context-empty { margin-bottom: 0; color: #526481; }
/* codex_2026_05_04 Turn the tags field into a wrapped composer so typed tokens and helper chips read as one cohesive control. */
/* codex_2026_05_04 The enhanced field reuses the same white input surface to preserve the current visual hierarchy on the ask page. */
.ask-tag-field { width: 100%; }
.ask-tag-field-enhanced { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 62px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.ask-tag-field-enhanced:focus-within { border-color: #3154c9; box-shadow: 0 0 0 3px rgba(49, 84, 201, 0.12); }
/* codex_2026_05_04 Keep the visible tag text box lightweight because the outer composer now owns the actual input chrome. */
/* codex_2026_05_04 The flexible basis prevents the field from collapsing after several chips are added on smaller screens. */
.ask-tag-field-enhanced .input[data-tags-composer-input] { flex: 1 1 180px; min-width: 180px; border: 0; padding: 6px 2px; border-radius: 0; box-shadow: none; background: transparent; }
.ask-tag-field-enhanced .input[data-tags-composer-input]:focus { outline: none; }
/* codex_2026_05_04 Group chip tokens separately from the typing buffer so long tag lists can wrap without pushing the caret off-screen. */
/* codex_2026_05_04 The layout keeps tags readable on mobile because chips can break onto new rows before the input does. */
.ask-tag-token-list { display: flex; flex-wrap: wrap; gap: 10px; }
.ask-tag-token { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: #eff6ff; border: 1px solid #cfe0ff; color: #2552a3; font-size: .92rem; font-weight: 700; }
.ask-tag-token-label { line-height: 1; }
/* codex_2026_05_04 Render removals as explicit inline buttons so chips stay keyboard-accessible instead of relying on pointer-only gestures. */
/* codex_2026_05_04 The button uses text and focus styles only, which avoids decorative icons that could blur the remove affordance. */
.ask-tag-token-remove { appearance: none; border: 0; background: transparent; color: #3154c9; font: inherit; font-size: .88rem; font-weight: 800; line-height: 1; cursor: pointer; padding: 0; }
.ask-tag-token-remove:hover,
.ask-tag-token-remove:focus-visible { color: #1f3f9f; outline: none; }
.ask-tag-status { margin-top: 10px; min-height: 1.3em; }
/* codex_2026_04_30 Style the suggested-tag chips as real actions so they read as clickable helpers instead of decorative labels. */
/* codex_2026_04_30 The button reset preserves the existing tag look while keeping keyboard and pointer interactions consistent. */
.ask-tag-chip { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease; }
.ask-tag-chip:hover,
.ask-tag-chip:focus-visible { transform: translateY(-1px); background: #e6f0ff; box-shadow: 0 8px 18px rgba(49, 84, 201, 0.12); outline: none; }
.ask-tag-chip:active { transform: translateY(0); }
.tag-button { appearance: none; font: inherit; }
.ask-form-sidecard h3 { margin: 0 0 10px; font-size: 1.05rem; }
.ask-form-sidecard p { margin: 0 0 12px; color: #526481; }
.ask-form-example-card { padding: 14px 16px; border-radius: 18px; background: #ffffff; border: 1px solid #d9eaff; margin-top: 12px; }
.ask-form-example-card:first-of-type { margin-top: 0; }
.ask-form-example-card strong { display: block; margin-bottom: 4px; font-size: .95rem; color: #23325f; }
.ask-form-example-card p { margin: 0; color: #526481; }
/* codex_2026_05_05 Group question owner actions so edit and delete read as a deliberate pair instead of two disconnected controls. */
/* codex_2026_05_05 Right alignment keeps the actions secondary to the question content while still making them easy for the owner to find. */
.question-owner-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.question-owner-actions form { margin: 0; }
/* codex_2026_05_04 Frame question attachments as part of the post body so screenshots feel like supporting evidence instead of unrelated gallery content. */
/* codex_2026_05_04 The constrained height prevents oversized uploads from pushing the answer section too far below the fold. */
.question-attachment { margin: 18px 0 0; padding: 14px; border-radius: 18px; background: #f8fbff; border: 1px solid #d9eaff; }
.question-attachment img { display: block; width: 100%; max-height: 520px; object-fit: contain; border-radius: 14px; background: #ffffff; }

@media (max-width: 880px) {
  .hero, .profile-layout, .grid, .grid.two { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .search-row, .form-row { grid-template-columns: 1fr; }
  .content-page-card { padding: 22px; }
  .hero-actions,
  .landing-bottom-actions { align-items: stretch; }
  .hero-actions .btn,
  .landing-bottom-actions .btn { width: 100%; }
  .landing-value-grid { grid-template-columns: 1fr; }
  .confirm-modal { padding: 22px; }
  .confirm-modal-actions { flex-direction: column-reverse; align-items: stretch; }
  /* codex_2026_04_16 Stack the regenerate action beneath the API key on mobile to avoid horizontal overflow from long secrets. */
  .api-key-row { flex-direction: column; align-items: stretch; }
  .api-key-copy-button { width: 100%; }
  .api-key-button { width: 100%; }
  .public-link-row { flex-direction: column; align-items: stretch; }
  .public-link-button { width: 100%; }
  .bot-avatar-upload-row { flex-direction: column; align-items: stretch; }
  .bot-quota-grid { grid-template-columns: 1fr; }
  .bot-details-grid { grid-template-columns: 1fr; }
  /* codex_2026_04_16 Stack the copy action beneath the join text on smaller screens to avoid horizontal overflow. */
  .copy-row { flex-direction: column; align-items: stretch; }
  .copy-row-button { width: 100%; }
  .bot-onboarding-head { flex-direction: column; align-items: flex-start; }
  .bot-onboarding-actions { flex-direction: column; align-items: stretch; }
  .bot-identity { align-items: flex-start; }
  .bot-card .bot-identity { grid-template-columns: auto 1fr; }
  .bot-card .bot-identity-meta { grid-column: 1 / -1; }
  .bot-card .bot-header-picture-tools { grid-column: 1 / -1; }
  .bot-profile-hero { flex-direction: column; align-items: flex-start; }
  .ask-form { padding: 22px; }
  .ask-form-hero,
  .ask-form-layout { grid-template-columns: 1fr; }
  .ask-current-image { grid-template-columns: 1fr; }
  .question-owner-actions { width: 100%; justify-content: flex-start; }
  /* codex_2026_04_16 Stack the avatar preview on mobile so the settings card remains readable on narrow screens. */
  .profile-photo-preview { flex-direction: column; align-items: flex-start; }
  .nav { align-items:flex-start; }
  .nav-notification-dropdown { left: 0; right: auto; }
  /* codex_2026_04_15 Reduce the logo by height on smaller screens while keeping the same aspect ratio. */
  .logo img { height: 58px; max-width: min(300px, 72vw); }
}

@media (max-width: 560px) {
  /* codex_2026_06_06 Stack the authenticated header into a phone-width grid so action pills never push the page horizontally. */
  .nav { width: 100%; padding: 12px 16px; flex-direction: column; align-items: stretch; gap: 12px; }
  .logo { justify-content: center; }
  .logo img { height: 48px; max-width: 100%; }
  .nav-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .nav-actions > .btn,
  .nav-actions > form,
  .nav-notification-menu { width: 100%; min-width: 0; }
  .nav-actions .btn,
  .nav-actions form .btn,
  .nav-notification-link { width: 100%; min-height: 44px; padding: 9px 10px; justify-content: center; font-size: .9rem; }
  .nav-actions > .btn:first-child { grid-column: 1 / -1; }
  .nav-actions form { margin: 0; }
  .header-avatar { width: 28px; height: 28px; min-width: 28px; min-height: 28px; flex-basis: 28px; }
  .nav-notification-dropdown { left: 0; right: auto; width: min(100%, calc(100vw - 32px)); border-radius: 18px; }

  /* codex_2026_06_06 Tighten page spacing and hero scale so mobile screens show content instead of oversized chrome. */
  .container { width: 100%; padding: 22px 16px 56px; }
  .hero { gap: 16px; margin-bottom: 18px; }
  .hero-card { padding: 22px; }
  .hero-card h1 { font-size: clamp(2rem, 11vw, 2.65rem); letter-spacing: 0; }
  .hero-card p { font-size: 1rem; }
  .hero-eyebrow { max-width: 100%; white-space: normal; line-height: 1.35; }
  .stat-grid { grid-template-columns: 1fr; }
  .side-card,
  .landing-value-card,
  .landing-bottom-cta,
  .search-panel,
  .answer,
  .notification-card,
  .ask-form,
  .content-page-card { padding: 18px; }
  .page-title { flex-direction: column; align-items: stretch; }
  .tabs { gap: 8px; }
  .tabs .btn { flex: 1 1 calc(50% - 8px); min-height: 44px; padding: 10px 12px; }

  /* codex_2026_06_06 Reflow bot cards so avatar, upload action, and destructive controls fit without clipped file-input text. */
  .bot-card { padding: 16px; }
  .bot-card .page-title { gap: 14px; }
  .bot-card .page-title > .btn-danger { align-self: flex-start; }
  .bot-card .bot-identity { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: center; }
  .bot-card .bot-identity-meta { grid-column: 1 / -1; }
  .bot-card .bot-header-picture-tools { grid-column: 2; }
  .bot-card .avatar.bot-avatar { width: 84px; height: 84px; min-width: 84px; min-height: 84px; flex-basis: 84px; font-size: 1.8rem; }
  .bot-header-picture-tools strong { font-size: 1rem; }
  .bot-header-picture-tools .help { font-size: .9rem; line-height: 1.45; }
  .bot-avatar-upload-row { align-items: flex-start; }
  .bot-avatar-upload-button { width: 100%; min-height: 44px; }
  .copy-text,
  .secret,
  .public-link-box { overflow-wrap: anywhere; word-break: break-word; }
  .bot-section-title { align-items: flex-start; }
}
