html, body { margin: 0; min-height: 100%; }
body { background: #eceef3; }
.wecraft-root {
  --w-body-md: 400 17px/1.6 var(--w-font-sans);
  --w-body-sm: 400 15px/1.5 var(--w-font-sans);
  --w-button: 600 17px/1.25 var(--w-font-sans);
  --w-label-md: 600 15px/1.3 var(--w-font-sans);
  min-height: 100dvh; display: flex; justify-content: center; font: var(--w-body-md); color: var(--w-ink);
}
.wecraft-device { width: 100%; height: 100dvh; position: relative; overflow: hidden; background: #F6F7F9; -webkit-font-smoothing: antialiased; }
.wecraft-device > div { min-height: 0; }
button, input, textarea, select { font-family: inherit; }
input, textarea, select { max-width: 100%; box-sizing: border-box; }
/* Keep form text readable and prevent the browser from zooming in on focus. */
.wecraft-root input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
.wecraft-root textarea,
.wecraft-root select { font-size: 16px !important; min-height: 48px; }
button:focus-visible, a:focus-visible { outline: 2px solid #8e2f55; outline-offset: 2px; }
.wecraft-header {
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  background: #F6F7F9;
  display: flex;
  align-items: center;
  gap: clamp(4px, 2vw, 10px);
  flex-shrink: 0;
}
.wecraft-header-action, .wecraft-brand, .wecraft-nav-action {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
}
.wecraft-header-action { flex-direction: column; gap: 4px; }
.wecraft-header-label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--w-ink-3); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.wecraft-header .wecraft-header-icon { font-size: 27px; height: 40px; display: flex; align-items: center; color: var(--w-navy-600); font-variation-settings: 'wght' 300; }
.wecraft-header-action[aria-current="page"] .wecraft-header-icon { font-variation-settings: 'FILL' 1; }
.wecraft-header-action[aria-current="page"] .wecraft-header-label { color: var(--w-navy); font-weight: 700; }
.wecraft-brand { min-width: 0; flex-shrink: 0; padding-bottom: 10px; }
.wecraft-brand > span { font-family: var(--w-font-display); font-weight: 800; font-size: clamp(21px, 6vw, 25px); line-height: 1; color: var(--w-navy); letter-spacing: var(--w-tracking-tight); }
.wecraft-bottom-nav {
  position: relative;
  z-index: 2;
  overflow: visible;
  display: flex;
  flex-shrink: 0;
  background: var(--w-surface);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -6px 24px rgba(13,29,42,.07);
  padding: 12px 4px 16px;
}
.wecraft-nav-action { flex: 1; min-width: 0; min-height: 56px; flex-direction: column; gap: 4px; padding: 6px 2px 0; }
@media (max-width: 359px) {
  .wecraft-header { padding-inline: 12px; gap: 4px; }
  .wecraft-header-label { font-size: 11px; }
}
@supports(padding: env(safe-area-inset-bottom)) { .wecraft-device { padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; } }
.wecraft-header, .wecraft-bottom-nav { flex-shrink: 0; }
.wecraft-assistant-host { height: 100%; min-height: 0; }
.wecraft-assistant-host > .sc-host { height: 100%; min-height: 0; }
.wecraft-profile-sheet { bottom: 0; max-height: 88vh; }
/* The keyboard can shrink just the visual viewport (Safari) or the whole WebView (Android). */
.wecraft-root:has(.wecraft-content--assistant),
html[data-wecraft-keyboard="true"] .wecraft-root { position: fixed; inset-inline: 0; top: var(--wecraft-viewport-top, 0px); height: var(--wecraft-viewport-height, 100dvh); min-height: 0; }
.wecraft-root:has(.wecraft-content--assistant) .wecraft-device,
html[data-wecraft-keyboard="true"] .wecraft-device { height: 100%; }
/* Keep navigation and floating shortcuts out of the typing area on every screen. */
html[data-wecraft-keyboard="true"] .wecraft-header,
html[data-wecraft-keyboard="true"] .wecraft-bottom-nav,
html[data-wecraft-keyboard="true"] .people-add { display: none !important; }
html[data-wecraft-keyboard="true"] .wecraft-device { padding-bottom: 0; }
html[data-wecraft-keyboard="true"] .people-screen { padding-bottom: 16px; }
/* Fixed profile dialogs are anchored to the layout viewport, even when only the visual viewport shrinks. */
html[data-wecraft-keyboard="true"] .wecraft-profile-sheet { bottom: calc(100% - var(--wecraft-viewport-height, 100dvh) - var(--wecraft-viewport-top, 0px)); max-height: calc(var(--wecraft-viewport-height, 100dvh) * .88); }
/* On desktop, keep the entire app (including fixed dialogs) inside a phone-sized surface. */
@media (min-width: 600px) {
  .wecraft-root {
    box-sizing: border-box;
    align-items: center;
    padding: 20px;
    background: #eceef3;
  }
  .wecraft-device {
    max-width: 402px;
    height: min(874px, calc(100dvh - 40px));
    max-height: min(874px, calc(100dvh - 40px));
    border-radius: 32px;
    box-shadow: 0 0 0 1px rgba(4,22,39,.12), 0 20px 60px rgba(4,22,39,.16);
    contain: layout;
  }
  .wecraft-profile-sheet { max-height: 88%; }
}

/* Settings use the same quiet surfaces, navy text and brand accents as the app. */
.settings-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(4,22,39,.4); }
.settings-panel { position: fixed; inset-inline: 0; bottom: 0; margin-inline: auto; width: 100%; max-width: 442px; max-height: 85vh; max-height: 85dvh; z-index: 51; display: flex; flex-direction: column; min-height: 0; border-radius: 26px 26px 0 0; background: var(--w-surface, #fff); color: var(--w-ink); box-shadow: 0 -8px 32px rgba(13,29,42,.1); overflow: hidden; }
.settings-header { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; background: var(--w-surface, #fff); border-bottom: 1px solid rgba(4,22,39,.06); }
.settings-header h1 { flex: 1; min-width: 0; margin: 0; font-family: var(--w-font-display); font-size: 18px; line-height: 1.4; color: var(--w-navy); font-weight: 600; }
.settings-header h1:focus { outline: none; }
.settings-icon-button { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: transparent; color: var(--w-ink-2); cursor: pointer; }
.settings-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px max(26px, env(safe-area-inset-bottom, 0px)); }
.settings-intro { margin: 0 4px 16px; font-size: 13px; line-height: 1.65; color: var(--w-ink-2); }
.settings-group { margin-block-end: 18px; }
.settings-group:last-child { margin-block-end: 0; }
.settings-group h2 { margin: 0 4px 9px; font-size: 13px; font-weight: 600; color: var(--w-ink-2); }
.settings-card { border: 1px solid rgba(4,22,39,.06); border-radius: 22px; background: var(--w-surface, #fff); overflow: hidden; box-shadow: 0 2px 10px rgba(13,29,42,.025); }
.settings-row { width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 14px; border: 0; background: transparent; text-align: start; color: inherit; font: inherit; }
.settings-row + .settings-row { border-top: 1px solid rgba(4,22,39,.07); }
button.settings-row { cursor: pointer; }
button.settings-row:hover { background: rgba(4,22,39,.025); }
.settings-row:focus-visible { outline-offset: -3px; border-radius: 12px; }
/* Keep centering when the shared icon-font stylesheet loads after this file. */
.settings-row-icon.material-symbols-outlined { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9999px; background: var(--w-brand-soft); color: var(--w-brand); flex-shrink: 0; font-size: 21px; }
.settings-row-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.settings-row-copy strong { font-size: 15px; line-height: 1.45; font-weight: 600; }
.settings-row-copy > span, .settings-row-copy bdi { font-size: 12.5px; line-height: 1.55; color: var(--w-ink-2); overflow-wrap: anywhere; }
.settings-row-copy bdi { align-self: flex-start; }
.settings-chevron { color: var(--w-ink-3); font-size: 20px; flex-shrink: 0; }
.settings-row--danger strong, .settings-row--danger .settings-row-icon { color: var(--w-danger); }
.settings-row--selected { background: var(--w-brand-soft); }
.settings-row--selected .settings-chevron, .settings-row--selected .settings-row-icon { color: var(--w-brand); }
.settings-switch { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; flex-shrink: 0; border: 0; background: transparent; cursor: pointer; border-radius: 10px; }
.settings-switch-track { display: block; position: relative; width: 40px; height: 24px; border-radius: 99px; background: rgba(4,22,39,.22); transition: background .15s; }
.settings-switch-track > span { position: absolute; width: 18px; height: 18px; inset-block-start: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(4,22,39,.16); transition: inset-inline-start .15s; }
.settings-switch[aria-checked="true"] .settings-switch-track { background: var(--w-brand); }
.settings-switch[aria-checked="true"] .settings-switch-track > span { inset-inline-start: 19px; }
.settings-panel button:disabled { opacity: .55; cursor: wait; }
.settings-message { padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--w-brand-soft); color: var(--w-brand); font-size: 13px; }
.settings-message--error { color: var(--w-danger); background: #fff; border: 1px solid currentColor; }
.settings-password { padding: 20px 16px; display: flex; flex-direction: column; gap: 18px; }
.settings-password label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.settings-password input, .settings-password select { width: 100%; border: 1px solid rgba(4,22,39,.13); border-radius: 12px; padding: 12px 14px; background: var(--w-surface, #fff); color: var(--w-ink); }
.settings-password input:focus-visible, .settings-password select:focus-visible { outline: 2px solid var(--w-brand); outline-offset: 2px; }
.settings-help { margin: -8px 0 0; color: var(--w-ink-2); font-size: 12.5px; line-height: 1.6; }
.settings-empty-state { margin: 0; padding: 20px 16px; color: var(--w-ink-2); font-size: 13px; line-height: 1.6; text-align: center; overflow-wrap: anywhere; }
.settings-save { min-height: 48px; margin-top: 4px; border: 0; border-radius: 99px; background: var(--w-brand); color: #fff; font: 600 14px/1.4 var(--w-font-sans); cursor: pointer; padding: 10px 18px; }
.settings-password .settings-password { padding: 0; gap: 14px; }
.settings-password > p { margin: 0; font-size: 14px; line-height: 1.6; }
.settings-row > .settings-save { min-height: 44px; margin: 0; border: 1px solid var(--w-line, #dedee3); background: white; color: var(--w-brand); }
@media (prefers-reduced-motion: reduce) { .settings-switch-track, .settings-switch-track > span { transition: none; } }
.settings-status { color: var(--w-brand); font-size: 13px; line-height: 1.5; }
.settings-status:not(:empty) { margin-bottom: 16px; }

/* Account lifecycle uses the same settings cards and typography. */
.account-consequence { margin: 0; font-size: 14px; line-height: 1.7; color: var(--w-ink-2); }
.settings-password .account-confirmation { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; line-height: 1.6; }
.settings-password .account-confirmation input { width: 20px; height: 20px; flex-shrink: 0; margin: 2px 0 0; padding: 0; accent-color: var(--w-brand); }
.settings-save--danger { background: var(--w-danger); }
.account-text-button { min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--w-ink-2); font: inherit; cursor: pointer; }
.account-text-button--danger { color: var(--w-danger); }
.account-paused { flex: 1; min-height: 0; overflow-y: auto; padding: 48px 24px 28px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.account-paused h1 { font-family: var(--w-font-display); font-size: 26px; line-height: 1.4; color: var(--w-navy); margin: 0; }
.account-paused p { font-size: 15px; line-height: 1.7; color: var(--w-ink-2); margin: 0 0 12px; }
.account-paused-icon { align-self: center; font-size: 48px; color: var(--w-brand); margin-bottom: 8px; }
.account-paused button:disabled { opacity: .55; cursor: wait; }
.account-result { flex-shrink: 0; margin: 16px 16px 0; }

/* Keep the composer in the available shell height; only conversation content scrolls. */
.wecraft-content--messages > .sc-host { height: 100%; min-height: 0; }
.message-screen { height: 100%; min-height: 0; max-width: 402px; margin: 0 auto; box-sizing: border-box; display: flex; flex-direction: column; background: #F6F7F9; color: var(--w-ink); font: var(--w-body-md); }
.message-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; }
.message-scroll > * { flex-shrink: 0; }
.message-composer { display: flex; align-items: flex-end; flex-shrink: 0; gap: 8px; padding: 10px 16px; background: #F6F7F9; border-top: 1px solid rgba(4,22,39,.06); }
.message-screen > [role="status"] { flex-shrink: 0; margin: 0; padding: 8px 16px; font-size: 13px; }
.wecraft-header-action { position: relative; }
.wecraft-unread-badge { position: absolute; top: 0; inset-inline-end: -2px; min-width: 18px; padding: 1px 4px; box-sizing: border-box; border-radius: 20px; background: var(--w-brand); color: white; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid #F6F7F9; }

/* Password reveal controls stay inside the field in both text directions. */
.wecraft-password-field { position: relative; display: flex; align-items: center; width: 100%; min-width: 0; }
.wecraft-password-field > input { width: 100%; min-width: 0; padding-inline-end: 52px !important; }
.wecraft-password-toggle { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; color: var(--w-ink-2); background: transparent; cursor: pointer; }
.wecraft-password-toggle:focus-visible { outline: 2px solid var(--w-brand); outline-offset: -2px; }
.wecraft-password-toggle:disabled { cursor: default; opacity: .5; }

/* Navigation button geometry and Rubik typography from the supplied redesign. */
.wecraft-root { --w-font-controls: 'Rubik', var(--w-font-sans); }
.wecraft-header-action, .wecraft-nav-action { font-family: var(--w-font-controls); }
.wecraft-header-label { font-weight: 500; }
.wecraft-header .wecraft-header-icon { width: 40px; height: 40px; justify-content: center; }
.wecraft-header-icon svg { width: 20px; height: 20px; }
.wecraft-header-action .wecraft-header-icon {
  box-sizing: border-box; border-radius: 9999px;
  background: var(--w-surface); border: 1px solid var(--w-line);
  box-shadow: 0 1px 2px rgba(4,22,39,.05);
}
.wecraft-bottom-nav { border-radius: 24px 24px 0 0; padding-top: 8px; }
.wecraft-nav-icon { width: 24px; height: 24px; flex-shrink: 0; }
.wecraft-nav-action--assistant { position: relative; top: -12px; }
.wecraft-assistant-button {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; flex-shrink: 0; box-sizing: border-box;
  margin-top: -12px; border: 4px solid #fff; border-radius: 50%;
  background: linear-gradient(to top right, #721940, #871F4C, #db2777);
  color: #fff; box-shadow: 0 8px 24px -4px rgba(158,42,91,.45);
  transition: transform .15s ease;
}
.wecraft-fab-icon { width: 24px; height: 24px; color: #fff; animation: wecraft-assistant-pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes wecraft-assistant-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@media (hover: hover) {
  .wecraft-nav-action--assistant:hover .wecraft-assistant-button { transform: scale(1.05); }
}
.wecraft-header-action, .wecraft-nav-action { transition: transform .15s ease; }
.wecraft-header-action:active, .wecraft-nav-action:active { transform: scale(.95); }
@media (prefers-reduced-motion: reduce) {
  .wecraft-header-action, .wecraft-nav-action { transition: none; }
  .wecraft-assistant-button { transition: none; }
  .wecraft-fab-icon { animation: none; }
}

.guest-signup-overlay{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:20px;background:#04162766}.guest-signup-dialog{position:relative;box-sizing:border-box;width:100%;max-width:360px;border:1px solid #d7d7dd;border-radius:28px;padding:34px 24px 24px;background:white;text-align:center;box-shadow:0 8px 30px #0002}.guest-signup-dialog h2{font-size:18px;line-height:1.6}.guest-signup-close{position:absolute;top:10px;inset-inline-end:14px;border:0;background:none;font-size:24px;color:#586474;cursor:pointer}

.wecraft-guest-header{display:flex;align-items:center;justify-content:center;flex-shrink:0;min-height:64px;padding:12px 20px;box-sizing:border-box;font:800 26px var(--w-font-sans);color:var(--w-ink)}
.wecraft-guest-header>span{direction:ltr}
.wecraft-guest-header>span>span{color:var(--w-brand)}
