/* =====================================================================================================================================
   Savannah AI — "graphite Glass". Loaded AFTER styles.css and chat-v1.css; it re-points the design tokens, adds the conversation-only sidebar, the
   Settings hub, the small thinking orb and the loading system. Palette: Smoky Black var(--sv-app-bg) · Deep graphite var(--sv-border) · off-white var(--sv-text) ·
   graphite Highlight var(--sv-text-3). off-white carries ALL small text; var(--sv-text-3) is for rings, icons, accents and large type only.
   There is no background artwork: the old butterfly wallpaper was removed (founder decision).
   ===================================================================================================================================== */
:root {
  --c-black: var(--sv-app-bg); --c-graphite: var(--sv-border); --c-offwhite: var(--sv-text); --c-silver: var(--sv-text-3);
  --c-charcoal: var(--sv-composer-bg); --c-charcoal: var(--sv-composer-bg); --c-graphite: var(--sv-border);
  --c-graphite: var(--c-graphite);
  --charcoal: var(--c-charcoal); --charcoal-2: var(--c-charcoal);
  --c-text-2: rgba(var(--sv-text-rgb), .74); --c-text-3: rgba(var(--sv-text-rgb), .6);
  --bg-surface: var(--sv-composer-bg); --bg-surface-raised: var(--sv-composer-bg); --bg-surface-hover: var(--sv-elevated);
  --border-subtle: rgba(var(--sv-text-3-rgb), .22); --border-strong: rgba(var(--sv-text-3-rgb), .44); --silver-border: rgba(var(--sv-text-3-rgb), .3);
  --accent-dim: rgba(var(--sv-border-rgb), .55);
  --success: var(--sv-text-2); --warning: var(--sv-text-2); --danger: var(--sv-text-3);
  --glass-fill: linear-gradient(180deg, rgba(var(--sv-border-rgb), .46), rgba(var(--sv-elevated-rgb), .38));
  --glass-fill-strong: rgba(var(--sv-elevated-rgb), .94);
  --glass-solid: var(--sv-border);
  --glass-border: rgba(var(--sv-text-3-rgb), .34); --glass-border-focus: rgba(var(--sv-text-3-rgb), .7);
  --glass-highlight: inset 0 1px 0 rgba(var(--sv-text-rgb), .10);
  --glow-none: 0 0 18px rgba(var(--sv-text-3-rgb), .35);
  --font-ui: var(--font-brand);
  --font-display: var(--font-brand);
}
:root[data-theme="contrast"] {
  --c-text-2: var(--sv-text); --c-text-3: rgba(var(--sv-text-rgb), .88); --border-subtle: rgba(var(--sv-text-rgb), .5); --border-strong: rgba(var(--sv-text-rgb), .8);
  --glass-border: rgba(var(--sv-text-rgb), .6); --glass-fill: rgba(var(--sv-composer-bg-rgb), .92);
}
html, body { font-family: var(--font-ui); }
h1, h2, h3, .page-header-row h2, .sh-title { font-family: var(--font-display); font-weight: 800; letter-spacing: -.015em; }
.sidebar-brand-name { font-family: var(--font-brand); font-weight: 400; letter-spacing: .14em; }
body { background: var(--sv-app-bg); }

/* ---- the original background, untouched -------------------------------------------------------------------------------------------------------------- */
/* No background artwork anywhere (founder decision): plain page colour behind the chat and Settings. */
body.view-ai, body.view-settings { background-color: var(--sv-app-bg); background-image: none; }
.main-column, #main { background: transparent; }

/* ---- sidebar: conversations only + the round Settings button ------------------------------------------------------------------------------------------ */
.sidebar { background: linear-gradient(180deg, rgba(var(--sv-composer-bg-rgb), .94), rgba(var(--sv-app-bg-rgb), .96)); border-right: 1px solid var(--border-subtle); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sidebar .drawer-tabs, .sidebar .nav-pane { display: none !important; }
.sidebar .chat-pane { display: flex !important; flex-direction: column; flex: 1; min-height: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 4px 14px; }
.sidebar-brand-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
.sidebar-tagline { display: block !important; width: auto; font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--c-text-3); order: 0; }
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.chat-pane-new { background: linear-gradient(180deg, var(--sv-text), var(--sv-text)) !important; color: var(--sv-app-bg) !important; border: 0 !important; border-radius: 999px !important; font-weight: 700; min-height: 44px; }
.chat-pane-search { border-radius: 999px !important; background: rgba(var(--sv-text-rgb), .06) !important; border: 1px solid var(--border-subtle) !important; color: var(--c-offwhite); }
.chat-pane-group { color: var(--c-text-3); }
.chat-pane-row.active { background: var(--accent-dim); border-left-color: var(--c-silver); }
.sidebar-settings { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 4px 4px; margin-top: 8px; border-top: 1px solid var(--border-subtle); }
.settings-orb {
  width: 48px; height: 48px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; position: relative; overflow: hidden;
  color: var(--c-offwhite); font-weight: 800; font-size: var(--sv-type-body-size); border: 1px solid var(--glass-border-focus);
  background: radial-gradient(circle at 35% 28%, rgba(var(--sv-text-rgb), .16), rgba(var(--sv-border-rgb), .88) 62%); box-shadow: var(--glow-none), var(--glass-highlight);
  transition: transform .16s ease, box-shadow .16s ease;
}
.settings-orb:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 0 26px rgba(var(--sv-text-3-rgb), .55), var(--glass-highlight); }
.settings-orb:focus-visible { outline: 2px solid var(--c-offwhite); outline-offset: 3px; }
.settings-orb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sh-avatar-img, .settings-orb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.settings-orb .gear { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-graphite); border: 1px solid var(--c-silver); display: grid; place-items: center; }
.settings-orb .gear svg { width: 11px; height: 11px; }
.sidebar-settings-label { font-size: var(--sv-type-tool-label-size); color: var(--c-text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-settings-label b { display: block; color: var(--c-offwhite); font-weight: 700; }
.sidebar-legal { font-size: var(--sv-type-metadata-size); color: var(--c-text-3); padding: 6px 4px 0; }
.sidebar-legal a { color: inherit; }
@media (min-width: 861px) {
  .sidebar { width: 300px; }
  .topbar .menu-toggle { display: none; }
}
@media (max-width: 860px) {
  .sidebar { transition: transform .18s ease; border-radius: 0 28px 28px 0; }
  .sidebar-overlay { transition: opacity .18s ease; background: rgba(0, 0, 0, .55); }
}

/* ---- loading system ---------------------------------------------------------------------------------------------------------------------------------- */
.skeleton { background: rgba(var(--sv-text-rgb), .07); border-radius: 8px; position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(var(--sv-text-2-rgb), .14), transparent); animation: sh-shimmer 1.4s infinite; }
@keyframes sh-shimmer { to { transform: translateX(100%); } }
.reveal > * { animation: sh-rise .18s ease-out both; }
@keyframes sh-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sh-pbar { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; z-index: 5; }
.sh-pbar i { position: absolute; top: 0; bottom: 0; width: 34%; background: linear-gradient(90deg, transparent, var(--c-silver), var(--sv-text-2), var(--c-silver), transparent); animation: sh-sweep 1.1s ease-in-out infinite; }
@keyframes sh-sweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(380%); } }
.view-loading { position: relative; padding: 24px; }
html.no-animation *, html.reduce-motion * { animation: none !important; transition: none !important; }
html.no-animation .skeleton::after, html.reduce-motion .skeleton::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition-duration: .01ms !important; } .skeleton::after { opacity: 0; } }

/* ---- Settings hub ------------------------------------------------------------------------------------------------------------------------------------ */
.sh-main { max-width: none; padding: 0 !important; }
.sh { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; min-height: calc(var(--app-height, 100dvh) - 56px); }
.sh-nav { padding: 26px 18px; border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 4px; background: rgba(var(--sv-app-bg-rgb), .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sh-nav-title { margin: 0 0 14px 10px; font-size: 28px; }
.sh-nav-item { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--c-offwhite); cursor: pointer; font: inherit; min-height: 48px; }
.sh-nav-item b { font-weight: 700; font-size: 14.5px; }
.sh-nav-item small { color: var(--c-text-3); font-size: var(--sv-type-tool-description-size); }
.sh-nav-item:hover { background: rgba(var(--sv-border-rgb), .28); }
.sh-nav-item.active { background: linear-gradient(90deg, rgba(var(--sv-border-rgb), .7), rgba(var(--sv-border-rgb), .3)); border-color: var(--glass-border); }
.sh-nav-item:focus-visible { outline: 2px solid var(--c-silver); outline-offset: 2px; }
.sh-body { padding: 30px clamp(18px, 4vw, 48px) 60px; min-width: 0; max-width: 860px; }
.sh-back { display: none; border: 0; background: transparent; color: var(--c-offwhite); font: inherit; font-weight: 700; padding: 6px 0 12px; cursor: pointer; }
.sh-title { margin: 0 0 4px; font-size: 30px; line-height: 1.15; text-shadow: 0 1px 12px rgba(0, 0, 0, .85); }
.sh-sub { margin: 0 0 18px; color: var(--c-text-2); font-size: var(--sv-type-subtitle-size); line-height: 1.55; max-width: 62ch; text-shadow: 0 1px 8px rgba(0, 0, 0, .85); }
.sh-h3 { margin: 0 0 10px; font-size: var(--sv-type-body-secondary-size); font-weight: 800; }
.sh-card { background: linear-gradient(180deg, rgba(var(--sv-composer-bg-rgb), .78), rgba(var(--sv-composer-bg-rgb), .74)); border: 1px solid var(--glass-border); border-radius: 20px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--glass-highlight); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sh-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.sh-label { font-size: var(--sv-type-tool-label-size); font-weight: 600; color: var(--c-text-2); }
.sh-input { width: 100%; box-sizing: border-box; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border-strong); background: rgba(var(--sv-text-rgb), .06); color: var(--c-offwhite); font: inherit; font-size: var(--sv-type-body-secondary-size); min-height: 46px; }
.sh-input:focus { outline: none; border-color: var(--c-silver); box-shadow: 0 0 0 3px rgba(var(--sv-text-3-rgb), .28); }
.sh-hint { margin: 4px 0 0; color: var(--c-text-3); font-size: 12.5px; line-height: 1.5; }
.sh-readonly { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 4px; }
.sh-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sh-actions .btn, .sh-avatar-actions .btn, .sh-tools .btn { border-radius: 999px; min-height: 44px; padding: 0 20px; font-weight: 700; }
.btn-glass { background: rgba(var(--sv-text-rgb), .07) !important; border: 1px solid var(--glass-border) !important; color: var(--c-offwhite) !important; }
.sh-status { min-height: 18px; font-size: var(--sv-type-tool-label-size); margin-top: 8px; color: var(--c-text-2); }
.sh-secret { display: block; margin: .4rem 0 .6rem; padding: .7rem .9rem; border-radius: 12px; font: 600 1.05rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; word-break: break-all; user-select: all; background: rgba(var(--sv-elevated-rgb), .5); border: 1px solid var(--sv-border); }
.sh-codes { list-style: none; margin: .5rem 0 .8rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .4rem; }
.sh-codes li code { display: block; padding: .5rem .7rem; border-radius: 10px; text-align: center; font: 600 .95rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .1em; user-select: all; background: rgba(var(--sv-elevated-rgb), .5); border: 1px solid var(--sv-border); }
.sh-status.ok, .sh-ok { color: var(--success); } .sh-status.err { color: var(--danger); } .sh-warn { color: var(--warning); }
.sh-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: var(--sv-type-tool-description-size); font-weight: 700; border: 1px solid var(--glass-border); }
.sh-badge.ok { color: var(--success); } .sh-badge.warn { color: var(--warning); } .sh-badge.off { color: var(--c-text-3); }
.sh-avatar-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.sh-avatar { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 38px; font-weight: 800; position: relative; overflow: hidden; flex: none; border: 1px solid var(--glass-border-focus); background: radial-gradient(circle at 35% 28%, rgba(var(--sv-text-rgb), .16), rgba(var(--sv-border-rgb), .88) 62%); box-shadow: var(--glow-none); }
.sh-avatar-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .sh-avatar-actions .sh-hint { flex-basis: 100%; }
.sh-progress { height: 4px; border-radius: 4px; background: rgba(var(--sv-text-rgb), .1); margin-top: 14px; overflow: hidden; } .sh-progress i { display: block; height: 100%; width: 0; background: var(--c-silver); transition: width .25s ease; }
.sh-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; } .sh-dl dt { color: var(--c-text-3); font-size: var(--sv-type-tool-label-size); } .sh-dl dd { margin: 0; overflow-wrap: anywhere; } .mono { font-family: var(--font-brand); font-size: 12.5px; }
.sh-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer; min-height: 56px; }
.sh-toggle:last-of-type { border-bottom: 0; } .sh-toggle.disabled { opacity: .7; cursor: default; }
.sh-toggle-copy { display: flex; flex-direction: column; gap: 2px; } .sh-toggle-copy small { color: var(--c-text-3); font-size: 12.5px; line-height: 1.45; }
.sh-switch { appearance: none; -webkit-appearance: none; flex: none; width: 48px; height: 28px; border-radius: 999px; background: rgba(var(--sv-text-rgb), .14); border: 1px solid var(--glass-border); position: relative; cursor: inherit; transition: background .16s; }
.sh-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--c-offwhite); transition: transform .16s; }
.sh-switch:checked { background: var(--c-graphite); border-color: var(--c-silver); } .sh-switch:checked::after { transform: translateX(20px); }
.sh-switch:focus-visible { outline: 2px solid var(--c-offwhite); outline-offset: 2px; }
.sh-tier { display: flex; gap: 14px; align-items: flex-start; padding: 12px 6px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; } .sh-tier.off { opacity: .6; cursor: not-allowed; }
.sh-tier-copy { display: flex; flex-direction: column; gap: 2px; } .sh-tier-copy small { color: var(--c-text-3); font-size: 12.5px; }
.sh-radio { accent-color: var(--c-silver); width: 20px; height: 20px; margin-top: 3px; }
.sh-app { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); } .sh-app:last-of-type { border-bottom: 0; }
.sh-app-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .sh-app-copy small { color: var(--c-text-3); font-size: 12.5px; overflow-wrap: anywhere; }
.sh-big { margin: 4px 0; font-size: 34px; font-weight: 800; font-family: var(--font-display); }
.sh-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; } .sh-links a, .sh-dl a { color: var(--c-offwhite); }
.sh-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.sh-embed { margin-top: 6px; }
@media (max-width: 860px) {
  .sh { grid-template-columns: 1fr; min-height: 0; }
  .sh .sh-body { display: none; } .sh.detail .sh-nav { display: none; } .sh.detail .sh-body { display: block; }
  .sh-nav { border-right: 0; padding: 18px 14px; background: transparent; } .sh-nav-item { min-height: 56px; }
  .sh-back { display: inline-block; min-height: 44px; }
  .sh-body { padding: 8px 16px 40px; max-width: none; } .sh-title { font-size: var(--sv-type-display-size); }
}

.notice-modal { padding: 8px 4px; max-width: 420px; } .notice-modal h3 { margin: 0 0 8px; font-weight: 800; } .notice-modal p { color: var(--c-text-2); line-height: 1.55; } .main-column { position: relative; }
/* ---- conversation list in the sidebar on every screen size (the phone drawer used these rules only inside its media query) ---- */
.chat-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-pane-new { flex: none; width: 100%; min-height: 48px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--accent); color: var(--text-inverse); font: inherit; font-weight: 600; cursor: pointer; }
.chat-pane-new:disabled { opacity: 0.6; }
.chat-pane-search { flex: none; width: 100%; box-sizing: border-box; margin: var(--space-3) 0 var(--space-2); border-radius: 12px; }
.chat-pane-chips { flex: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-1); }
.chat-pane-chip { min-height: 44px; max-width: 100%; padding: 0 var(--space-3); border: 1px solid var(--border-subtle); border-radius: 999px; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--text-sm); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pane-chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--text-primary); }
.chat-pane-status { flex: none; margin: var(--space-1) 0; font-size: var(--text-xs); color: var(--text-secondary); }
.chat-pane-status:empty { display: none; }
.chat-pane-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: var(--space-2); }
.chat-pane-group { margin: var(--space-4) 0 var(--space-1); padding: 0 var(--space-2); font-size: var(--sv-type-metadata-size); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); font-weight: 600; }
.chat-pane-empty { padding: var(--space-3) var(--space-2); color: var(--text-secondary); font-size: var(--text-sm); }
.chat-pane-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; border-left: 3px solid transparent; border-radius: 10px; }
.chat-pane-row.active { background: var(--accent-dim); border-left-color: var(--accent); }
.chat-pane-open { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-width: 0; min-height: 48px; padding: var(--space-1) var(--space-2); background: none; border: 0; text-align: left; color: var(--text-primary); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.chat-pane-row.active .chat-pane-open { font-weight: 600; }
.chat-pane-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pane-badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--sv-type-metadata-size); color: var(--text-secondary); letter-spacing: 0.04em; }
.chat-pane-more { min-width: 44px; min-height: 44px; background: none; border: 0; color: var(--text-secondary); font-size: var(--sv-type-heading-lg-size); cursor: pointer; }
.chat-pane-menu { grid-column: 1 / -1; display: flex; gap: 8px; padding: 0 var(--space-2) var(--space-2); }
.chat-pane-action { flex: 1; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-surface-raised); color: var(--text-primary); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.chat-pane-action.danger { color: var(--danger); background: var(--danger-dim); border-color: transparent; }
.chat-pane-org { flex: none; display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); font-size: var(--text-sm); min-width: 0; }
.chat-pane-org:empty { display: none; }
.chat-pane-org-label { flex: none; font-size: var(--sv-type-metadata-size); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); }
.chat-pane-org-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pane-org .scope-select { flex: 1; min-width: 0; max-width: none; }
.chat-pane-open { background: transparent; border: 0; color: var(--c-offwhite); text-align: left; cursor: pointer; font: inherit; } .chat-pane-more, .chat-pane-action { cursor: pointer; } .chat-pane-open:hover { background: rgba(var(--sv-border-rgb), .28); border-radius: 10px; }
/* final overrides (must come after the copied conversation-list rules) */
.chat-pane-menu[hidden], .chat-pane [hidden] { display: none !important; }
@media (min-width: 861px) { .sidebar .chat-pane-org { display: none !important; } }   /* desktop: the top bar already has the organization switcher; phones keep it in the drawer */
/* messages: user = graphite glass; Savannah's replies = dark charcoal glass cards so text never sits directly on the artwork */
.chat-message.role-user { background: linear-gradient(180deg, rgba(var(--sv-border-rgb), .72), rgba(var(--sv-border-rgb), .66)); border-color: var(--glass-border-focus); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.chat-message.role-assistant { padding: 12px 16px 14px; border-radius: 20px 20px 20px 7px; background: linear-gradient(180deg, rgba(var(--sv-composer-bg-rgb), .78), rgba(var(--sv-composer-bg-rgb), .74)); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); max-width: 92%; }
.chat-message.role-assistant::before { display: none; }
@media (prefers-reduced-transparency: reduce) { .chat-message.role-user { background: var(--sv-border); } .chat-message.role-assistant { background: var(--sv-composer-bg); } }

/* ---- password show / hide ---- */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap .pw-input { padding-right: 52px !important; width: 100%; box-sizing: border-box; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--c-text-2); cursor: pointer; padding: 0; }
.pw-toggle:hover { color: var(--c-offwhite); background: rgba(var(--sv-border-rgb), .35); }
.pw-toggle:focus-visible { outline: 2px solid var(--c-offwhite); outline-offset: -2px; box-shadow: 0 0 0 4px rgba(var(--sv-text-3-rgb), .35); }
.pw-toggle[aria-pressed="true"] { color: var(--c-offwhite); background: rgba(var(--sv-border-rgb), .55); }
.pw-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---- task orchestration: Activity button, composer mode, toasts, task panel extras ---- */
.activity-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--glass-border); background: rgba(var(--sv-composer-bg-rgb), .55); color: var(--c-offwhite); font: inherit; font-size: var(--text-sm); cursor: pointer; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.activity-button:hover { border-color: var(--glass-border-focus); background: rgba(var(--sv-border-rgb), .45); }
.activity-button:focus-visible { outline: 2px solid var(--c-offwhite); outline-offset: 2px; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-text-2); flex: none; }
.activity-button.has-activity .activity-dot { background: var(--c-silver, var(--sv-text-3)); }
.activity-button.busy .activity-dot { background: var(--sv-text); animation: activity-pulse 1.4s ease-in-out infinite; }
.activity-count { font-size: var(--sv-type-tool-description-size); color: var(--c-text-2); white-space: nowrap; }
.activity-count:empty { display: none; }
@keyframes activity-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.75); } }
.reduce-motion .activity-button.busy .activity-dot, .no-animation .activity-button.busy .activity-dot { animation: none; }
@media (prefers-reduced-motion: reduce) { .activity-button.busy .activity-dot { animation: none; } }
@media (max-width: 860px) { .activity-label { display: none; } .activity-button { padding: 0 12px; } .activity-count { max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; } }

.composer-mode-wrap { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.composer-mode { min-height: 44px; max-width: 100%; border-radius: 22px; border: 1px solid var(--glass-border); background: rgba(var(--sv-composer-bg-rgb), .6); color: var(--c-offwhite); font: inherit; font-size: var(--text-sm); padding: 0 12px; }
.composer-mode:focus-visible { outline: 2px solid var(--c-offwhite); outline-offset: 2px; }
.composer-mode option { background: var(--sv-composer-bg); color: var(--c-offwhite); }
.composer-mode-hint { font-size: var(--sv-type-tool-label-size); color: var(--c-text-2); padding: 4px 12px 0; }

.toast-host { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 14px; border: 1px solid var(--glass-border); background: rgba(var(--sv-composer-bg-rgb), .94); color: var(--c-offwhite); font-size: var(--text-sm); box-shadow: 0 8px 28px rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.toast.ok { border-color: rgba(var(--sv-text-3-rgb), .6); }
.toast.warn { border-color: var(--sv-text-3); }
.toast.error { border-color: var(--sv-text-3); }
.toast span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-x { flex: none; min-width: 44px; min-height: 44px; margin: -10px -12px -10px 0; border: 0; background: transparent; color: var(--c-text-2); font-size: var(--sv-type-heading-lg-size); cursor: pointer; }
@media (max-width: 860px) { .toast-host { left: 16px; right: 16px; top: calc(72px + env(safe-area-inset-top, 0px)); bottom: auto; max-width: none; } }   /* phones: below the header, never over the composer */

.badge.status-running { background: rgba(var(--sv-text-3-rgb), .22); color: var(--sv-text-2); }
.task-instruction-form { margin-top: 8px; display: grid; gap: 8px; }
.task-instruction-input { width: 100%; box-sizing: border-box; min-height: 64px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(var(--sv-app-bg-rgb), .6); color: var(--c-offwhite); font: inherit; padding: 10px 12px; resize: vertical; }
.task-review { margin-top: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--glass-border); background: rgba(var(--sv-composer-bg-rgb), .55); }
.task-review-title { margin: 0 0 4px; font-size: var(--text-sm); font-weight: 700; }
.task-review-files { margin: 6px 0; padding-left: 18px; font-family: var(--font-brand); font-size: var(--sv-type-tool-label-size); overflow-wrap: anywhere; }
.task-review-overlap { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(var(--sv-text-3-rgb), .14); color: var(--sv-text-2); font-size: var(--sv-type-tool-label-size); }
