:root {
  /* Names this page grew up with, pointed at the shared theme. */
  --paper: var(--bg);
  --accent-dark: var(--accent-strong);
  --sand: var(--hl);
  --sand-light: var(--hl-row);
  --bubble-user: var(--accent-soft);
  --card-bg: var(--panel);
  --font-sans: var(--f-ui);
  --font-serif: var(--f-display);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
}

.app-layout {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  margin: 0;
  overflow: hidden;
}

/* Sidebar */
.chat-sidebar {
  width: var(--side-w);
  min-width: var(--side-w);
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex-shrink: 0;
  transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  position: relative;
}

.chat-sidebar.collapsed {
  margin-left: calc(-1 * var(--side-w));
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand-icon {
  font-size: 1.15rem;
}

.sidebar-brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.sidebar-new-chat-wrapper {
  padding: 12px 12px 6px;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
  background: var(--accent);
  color: white;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.new-chat-btn:hover {
  background: var(--accent-dark);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9;
}

.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
}

.sidebar-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 8px 8px;
}

.sidebar-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px;
}

.sidebar-label-row .sidebar-label {
  padding: 0;
}

.clear-all-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1;
}

.clear-all-btn:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.clear-all-btn[hidden] {
  display: none !important;
}

.conversations-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conversations-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 24px 8px;
}

.conversation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  gap: 6px;
  width: 100%;
}

.conversation-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.conversation-item.active {
  background: white;
  border-color: var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.conv-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.conv-icon {
  font-size: 0.85rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.conv-title {
  font-size: 0.84rem;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-item.active .conv-title {
  font-weight: 600;
  color: var(--accent-dark);
}

.conv-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.conv-date {
  font-size: 0.7rem;
  color: var(--muted);
}

.conv-delete-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.conversation-item:hover .conv-delete-btn {
  display: inline-flex;
}

.conv-delete-btn:hover {
  color: var(--error-text);
  background: var(--error-bg);
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--hover);
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.sidebar-user:hover {
  background: var(--hover);
}

.sidebar-user:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar-user .user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}

.sidebar-user .user-meta strong {
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-meta small {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chat Panel */
.chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100vh;
  min-width: 0;
  background: var(--panel);
}

/* Header */
.app-header {
  flex-shrink: 0;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s ease;
  margin-right: 12px;
  animation: fadeInToggle 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Only display header toggle button when the sidebar is collapsed */
.chat-sidebar.collapsed ~ .chat-panel .sidebar-toggle-btn {
  display: flex;
}

@keyframes fadeInToggle {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.sidebar-toggle-btn:hover {
  background: white;
  border-color: var(--accent);
}

.brand {
  display: flex;
  align-items: center;
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.brand .eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand h1 {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Model Selector (Claude / Codex inspired) */
.model-selector-container {
  position: relative;
}

.model-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--hover);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.model-selector-btn:hover {
  background: var(--line-2);
  border-color: var(--line);
}

.model-dot-icon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2b8a3e;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.model-dot-icon.sonnet {
  background: #d97706;
}

.chevron-icon {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.model-selector-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.model-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
  min-width: 180px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -4px rgba(0, 0, 0, 0.04);
  padding: 4px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.model-dropdown-menu[hidden] {
  display: none !important;
}

.model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
}

.model-option:hover {
  background: var(--hover);
}

.model-option.active {
  background: var(--hover);
}

.model-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.model-notice-banner {
  background: #fef3c7;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.model-opt-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}

.opt-check {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.model-option.active .opt-check {
  opacity: 1;
}

.employee-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
}

.employee-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.employee-meta strong {
  font-size: 0.88rem;
}

.employee-meta span {
  font-size: 0.76rem;
  color: var(--muted);
}

.pill-btn {
  margin-left: 0;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sand-light);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: var(--sand);
  border-color: var(--accent);
}
/* The graph entry is a link, not a button, so it needs the parts of button
   styling an anchor does not inherit. */
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.persona-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.persona-pill-btn:hover {
  background: var(--hover);
  border-color: var(--accent);
}

.persona-switch-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 2px;
}

/* Main Chat Container */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Empty State */
.empty-state {
  margin: auto;
  max-width: 600px;
  text-align: center;
  padding: 32px 20px;
}

.empty-avatar-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.sobo-canvas {
  width: 150px;
  height: 150px;
  max-width: 100%;
  cursor: pointer;
  filter: drop-shadow(0 10px 16px rgba(75, 63, 209, 0.16));
  display: block;
}

.empty-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.empty-state h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin: 0 0 10px;
  font-weight: 500;
}

.empty-state p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 24px;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background: white;
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Chat Messages */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message-bubble {
  max-width: min(820px, 92%);
  border-radius: 18px;
  padding: 18px 22px;
  line-height: 1.6;
  font-size: 0.96rem;
}

.message-row.user .message-bubble {
  background: var(--bubble-user);
  border: 1px solid var(--line);
  border-bottom-right-radius: 4px;
}

.message-row.assistant .message-bubble {
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 18px rgba(40, 30, 120, 0.04);
}

/* Message Content Markdown */
.message-bubble h2,
.message-bubble h3 {
  font-family: var(--font-serif);
  margin: 1.2em 0 0.4em;
  line-height: 1.25;
}

.message-bubble h2 {
  font-size: 1.35rem;
}

.message-bubble h3 {
  font-size: 1.12rem;
}

.message-bubble p {
  margin: 0.6em 0;
}

.message-bubble p:first-child {
  margin-top: 0;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble ul,
.message-bubble ol {
  margin: 0.6em 0;
  padding-left: 1.4rem;
}

.message-bubble li + li {
  margin-top: 0.35em;
}

.message-bubble code {
  padding: 0.15em 0.35em;
  border-radius: 4px;
  background: var(--line);
  font-size: 0.9em;
}

.message-bubble pre code {
  display: block;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 8px;
}

.message-bubble blockquote {
  margin: 0.8em 0;
  padding-left: 0.9rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

/* Inline Citation Badges */
.inline-citation {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  margin: 0 3px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--sand-light);
  color: var(--accent-dark);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: baseline;
}

.inline-citation:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Metadata & Sources section inside assistant message */
.message-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.context-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.context-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.context-tag.updated {
  background: #dff1e8;
  color: var(--accent-dark);
}

.context-tag.referenced {
  background: var(--sand-light);
  color: #725816;
}

.context-tag.runtime {
  background: var(--hover);
  color: #495057;
  border: 1px solid #e2e8f0;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.context-tag.model-badge {
  font-weight: 600;
  border: 1px solid transparent;
}

.context-tag.model-badge.sonnet {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.context-tag.model-badge.soclaas {
  background: var(--good-bg);
  color: #137333;
  border-color: #ceead6;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.source-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.source-card:hover {
  border-color: var(--accent);
  background: var(--panel-2);
  transform: translateY(-1px);
}

.source-card span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.source-card strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-card small {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  width: fit-content;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.status-indicator[hidden] {
  display: none !important;
}

#status-text {
  display: inline-block;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#status-text.fade-out {
  opacity: 0;
  transform: translateY(-3px);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error message banner */
.error-bubble {
  background: var(--error-bg);
  border: 1px solid #f8b4b4;
  color: var(--error-text);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.92rem;
}

/* Input Form Bar */
.input-container {
  flex-shrink: 0;
  padding: 14px 24px 20px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.chat-form {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px 14px 10px 18px;
  box-shadow: 0 4px 14px rgba(40, 30, 120, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(75, 63, 209, 0.14);
}

textarea#message-input {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  font: inherit;
  font-size: 0.96rem;
  color: var(--ink);
  line-height: 1.5;
  padding: 0 0 6px 0;
  max-height: 180px;
  min-height: 28px;
  background: transparent;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.send-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-dark);
}

.send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stop-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #18181b;
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.stop-btn:hover {
  background: #27272a;
  transform: scale(1.06);
}

.stop-btn:active {
  transform: scale(0.95);
}

.input-footer {
  text-align: center;
}

.privacy-note {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
}

/* Modals / Dialogs */
dialog {
  width: min(740px, calc(100% - 32px));
  max-height: 85vh;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

dialog::backdrop {
  background: rgba(28, 26, 51, 0.6);
  backdrop-filter: blur(2px);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.dialog-header h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 4px 0 6px;
}

.source-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.source-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.close-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
}

.close-btn:hover {
  background: var(--hover);
}

.dialog-body pre {
  margin: 0;
  max-height: 55vh;
  overflow-y: auto;
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  background: white;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* Memory Items List */
.memory-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
}

.memory-item-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
}

.memory-item-card .item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.memory-item-card strong {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.84rem;
  color: var(--accent);
}

.memory-item-card small {
  font-size: 0.74rem;
  color: var(--muted);
}

.memory-item-card pre {
  margin: 0;
  font-family: inherit;
  font-size: 0.88rem;
  white-space: pre-wrap;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0;
}

@media (max-width: 768px) {
  .chat-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }
  .chat-sidebar.collapsed {
    transform: translateX(-100%);
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 12px 16px;
  }
  .header-content {
    gap: 8px;
  }
  .header-actions {
    gap: 4px;
  }
  .model-selector-btn,
  .pill-link,
  .employee-badge .pill-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }
  .employee-badge {
    padding: 0;
    border: 0;
    background: transparent;
  }
  #selected-model-name,
  .header-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .employee-meta span {
    display: none;
  }
  .input-container {
    padding: 10px 14px 14px;
  }
}

/* A live panel the agent attached to its answer (the recruiting page, framed). */
/* A panel is a working surface, so its message is wider than a text reply. */
.message-bubble.has-block {
  width: min(1180px, 96%);
  max-width: min(1180px, 96%);
}

.chat-block {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
}

.chat-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.chat-block-head a {
  color: var(--accent);
  text-decoration: none;
}

.chat-block-body iframe {
  display: block;
  width: 100%;
  height: 620px;
  border: 0;
}

.chat-block-reopen {
  display: block;
  width: 100%;
  padding: 14px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 768px) {
  .chat-block-body iframe { height: 520px; }
}

/* Auth / Login Modal */
.auth-dialog {
  width: min(640px, calc(100% - 24px));
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.auth-dialog::backdrop {
  background: rgba(28, 26, 51, 0.7);
  backdrop-filter: blur(4px);
}

.auth-modal-card {
  position: relative;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
}

.login-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: 0;
  font-size: 1.15rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s ease;
  z-index: 10;
}

.login-close-btn:hover {
  background: var(--line-2);
  color: var(--ink);
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-brand-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--accent-dark);
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.auth-header h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--ink);
  margin: 4px 0 8px;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.45;
}

.persona-selector {
  margin: 8px 0 16px;
}

.persona-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.persona-search-wrapper {
  flex: 1;
  min-width: 200px;
}

.persona-search-input {
  width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.80rem;
  font-family: inherit;
  outline: 0;
  background: var(--panel-2);
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.persona-search-input:focus {
  border-color: var(--accent);
  background: white;
}

.persona-section-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}

.persona-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: white;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-align: left;
}

.persona-card:hover {
  border-color: var(--accent);
  background: var(--panel-2);
  transform: translateY(-1px);
}

.persona-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(75, 63, 209, 0.22);
}

.persona-avatar {
  font-size: 1.7rem;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.persona-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.persona-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.persona-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.persona-role {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1px;
}

.persona-dept-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  margin-top: 4px;
}

.auth-form {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.auth-form input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(75, 63, 209, 0.15);
}

.auth-form .form-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.auth-error-banner {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 0.82rem;
  font-weight: 500;
}

.auth-actions {
  margin-top: 16px;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.auth-submit-btn:hover {
  background: var(--accent-dark);
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

/* Confirmation Dialog */
.confirm-dialog {
  width: min(400px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.confirm-dialog::backdrop {
  background: rgba(28, 26, 51, 0.65);
  backdrop-filter: blur(4px);
}

.confirm-modal-card {
  padding: 26px 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.confirm-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fdf2f2;
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 14px;
}

.confirm-modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0 0 8px;
  font-weight: 600;
}

.confirm-modal-message {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 22px;
  max-width: 310px;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.confirm-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.90rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.confirm-btn.secondary {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}

.confirm-btn.secondary:hover {
  background: var(--hover);
  border-color: #cbd5e1;
}

.confirm-btn.destructive {
  background: #dc2626;
  border: 1px solid #dc2626;
  color: white;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

.confirm-btn.destructive:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.confirm-btn:active {
  transform: translateY(1px);
}

/* ------------------------------------------------------------------
   Shared shell: lavender ground, the conversation on a white sheet. */

body { background: var(--bg); font-size: 14px; }
.chat-sidebar { background: var(--bg); border-right: 0; }
/* The sidebar's frame, top row and app links come from .shell-side in theme.css. */
.sidebar-header.shell-top { justify-content: space-between; padding: 0 0 0 8px; border-bottom: 0; }
.sidebar-apps { padding: 0; }
.sidebar-new-chat-wrapper { padding: 6px 0; }
.sidebar-history { padding: 12px 0; }
.new-chat-btn { border-radius: var(--radius-pill); box-shadow: none; }
.sidebar-label { color: var(--faint); letter-spacing: 0; text-transform: none; font-weight: 500; }
.conversation-item { border-radius: var(--radius-pill); }

.app-header { border-bottom: 1px solid var(--line-2); padding: 12px 20px; }
.brand h1 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.input-container { background: var(--panel); border-top: 0; }
.input-wrapper { border-radius: var(--radius-float); box-shadow: var(--shadow-float); }
.message-row.user .message-bubble { border-color: transparent; }
.message-row.assistant .message-bubble { box-shadow: none; }
.chip { border-radius: var(--radius-pill); }
.empty-state h2 { letter-spacing: -0.02em; }

@media (max-width: 760px) {
  .chat-panel { margin: 0; height: 100vh; border-radius: 0; border: 0; }
}

button, input, textarea, select { font-family: inherit; }
.new-chat-btn { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.new-chat-btn:hover { background: var(--hover); }
.line-icon { flex: none; vertical-align: -2px; }
.context-tag { display: inline-flex; align-items: center; gap: 5px; }
.conv-icon { display: inline-flex; color: var(--faint); }
.shell-user#sidebar-user-container { cursor: pointer; }
.shell-user#sidebar-user-container:hover .shell-name { color: var(--accent); }
.persona-avatar { border-radius: 50%; overflow: hidden; background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* A role's candidates pinned beside the chat: a second sheet on the right. */
.pinned-panel {
  flex: none; width: clamp(360px, 40vw, 600px); height: calc(100vh - 16px); margin: 8px 8px 8px 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-surface);
}
.pinned-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 46px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line-2);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.unpin-panel { border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.unpin-panel:hover { background: var(--hover); color: var(--ink); }
.pinned-body { flex: 1; min-height: 0; }
.pinned-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.pin-panel {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; color: var(--accent); font: 500 12px/1 var(--f-ui); padding: 4px 8px; border-radius: var(--radius-pill); cursor: pointer;
}
.pin-panel:hover { background: var(--accent-soft); }
.chat-block-note { margin: 0; padding: 10px 14px; color: var(--muted); font-size: 12.5px; }
@media (max-width: 1100px) {
  .pinned-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 20; margin: 8px; height: auto; box-shadow: var(--shadow-float); }
}
.composer-toolbar { justify-content: flex-end; }

/* ------------------------------------------------------------ the answer's graph
   A small picture of what an answer's evidence connects to, above the
   evidence cards. The whole thing is one button: it opens the graph page for
   this answer in a dialog. Kind colours match the graph page. */
.answer-graph {
  --k-person: #4f8f82;
  --k-organization: #5b6b7c;
  --k-item: #1f6d5f;
  --k-event: #b7862b;
  --k-document: #4a6fa5;
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin: 8px 0 2px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.answer-graph:hover,
.answer-graph:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
  outline: none;
}
.answer-graph-picture {
  flex: 1 1 auto;
  min-width: 0;
  height: 132px;
}
.answer-graph.loading .answer-graph-picture {
  background: linear-gradient(90deg, var(--line-2), var(--hover), var(--line-2));
  border-radius: 8px;
}
.answer-graph-caption {
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.answer-graph-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
}
.answer-graph-count {
  font-size: 0.72rem;
  color: var(--muted);
}
.ag-edge { stroke: var(--faint); stroke-opacity: 0.55; stroke-width: 1; }
.ag-edge.matches { stroke: var(--ink); stroke-opacity: 0.18; }
.ag-person { fill: var(--k-person); }
.ag-organization { fill: var(--k-organization); }
.ag-item { fill: var(--k-item); }
.ag-event { fill: var(--k-event); }
.ag-document { fill: var(--k-document); }
.ag-query { fill: var(--ink); }
.ag-label {
  font-family: var(--f-ui);
  font-size: 8.5px;
  fill: var(--muted);
  text-anchor: middle;
}

.answer-graph-dialog {
  width: min(1320px, 94vw);
  height: min(900px, 90vh);
  max-width: none;
  max-height: none;
  padding: 0;
  display: none;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-float);
  background: var(--panel);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.answer-graph-dialog[open] { display: flex; }
.answer-graph-dialog-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line-2);
}
.answer-graph-dialog-title {
  flex: 1;
  min-width: 0;
  font-family: var(--f-display);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.answer-graph-dialog iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: var(--bg);
}

@media (max-width: 720px) {
  .answer-graph { flex-direction: column; }
  .answer-graph-caption { flex-basis: auto; }
  .answer-graph-dialog { width: 100vw; height: 100vh; border-radius: 0; }
}

/* ------------------------------------------------------------ the chosen day
   A compact date control in the header: step a working day back or forward,
   or pick one. Looking at a past day tints it, so it is never forgotten. */
.as-of {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--panel);
}
.as-of[hidden] { display: none; }
.as-of.past { border-color: var(--hl-edge); background: var(--hl-row); }
.as-of-step, .as-of-now {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  border-radius: var(--radius-pill); display: grid; place-items: center;
  min-width: 28px; height: 28px; padding: 0 6px; font: 600 12px/1 var(--f-ui);
}
.as-of-step:hover:not(:disabled), .as-of-now:hover { background: var(--hover); color: var(--ink); }
.as-of-step:disabled { opacity: 0.35; cursor: default; }
.as-of-now { color: var(--accent); }
.as-of-field { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; cursor: pointer; }
.as-of-caption { font: 600 12px/1 var(--f-ui); color: var(--muted); white-space: nowrap; }
/* In the present the date speaks for itself; "As of" marks a past day. */
.as-of:not(.past) .as-of-caption { display: none; }
.as-of.past .as-of-caption { color: var(--warn); }
.as-of-field input {
  border: 0; background: transparent; color: var(--ink); font: 500 13px/1 var(--f-ui);
  padding: 4px 0; min-width: 0; width: 8.4em;
}
.as-of-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
#today-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; }
.brand h1, #selected-model-name, .header-actions .pill-btn { white-space: nowrap; }
/* With the Today panel open the chat is narrower: the header's buttons drop their words. */
@media (min-width: 769px) and (max-width: 1600px) {
  body.today-open .header-action-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  body.today-open .pill-link, body.today-open .employee-badge .pill-btn {
    width: 34px; height: 34px; padding: 0; justify-content: center; display: inline-flex; align-items: center;
  }
  body.today-open .employee-badge { padding: 0; border: 0; background: transparent; }
}
#today-toggle[hidden], #company-graph-link[hidden] { display: none; }
#today-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.context-tag.as-of-tag { background: var(--hl-row); color: var(--warn); }

/* The Today panel: a second sheet beside the chat, like the pinned panel. */
.today-panel {
  flex: none; width: clamp(300px, 28vw, 380px); height: calc(100vh - 16px); margin: 8px 8px 8px 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-surface);
}
.today-panel[hidden] { display: none; }
.today-head {
  flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 12px 10px 10px 16px; border-bottom: 1px solid var(--line-2);
}
.today-head h2 { margin: 0; font: 600 15px/1.3 var(--f-display); color: var(--ink); }
.today-date { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.viewing-past .today-date { color: var(--warn); font-weight: 600; }
.today-close { border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.today-close:hover { background: var(--hover); color: var(--ink); }
.today-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; }
.today-section h3 {
  margin: 14px 0 6px; font: 600 12px/1.2 var(--f-ui); letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint);
}
.today-list h4 { margin: 10px 0 4px; font: 600 12.5px/1.3 var(--f-ui); color: var(--ink-2); }
.today-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.todo-item {
  width: 100%; text-align: left; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 2px;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-control);
  background: var(--panel-2); color: var(--ink); font: inherit;
}
button.todo-item { cursor: pointer; }
button.todo-item:hover { border-color: var(--accent); background: var(--hover); }
.todo-key { font: 500 11.5px/1.5 var(--f-mono); color: var(--accent); }
.todo-title { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.todo-facts { grid-column: 2; font-size: 11.5px; color: var(--muted); }
.today-plan { margin: 0; padding: 0 0 0 20px; display: grid; gap: 8px; }
.plan-item { font-size: 13px; line-height: 1.4; color: var(--ink); }
.plan-item::marker { color: var(--faint); font-size: 12px; }
.plan-title { display: block; overflow-wrap: anywhere; }
.plan-facts, .plan-deferred { display: block; font-size: 11.5px; color: var(--muted); }
.plan-item.deferred .plan-title { text-decoration: line-through; color: var(--muted); }
.plan-deferred { color: var(--warn); }
.today-more {
  margin-top: 6px; border: 0; background: none; color: var(--accent); cursor: pointer;
  font: 500 12.5px/1 var(--f-ui); padding: 6px 4px; border-radius: 6px;
}
.today-more:hover { background: var(--accent-soft); }
.today-empty { margin: 4px 0; font-size: 12.5px; color: var(--muted); list-style: none; }
.today-note { margin: 18px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.45; }

@media (max-width: 1100px) {
  .today-panel {
    position: fixed; right: 0; top: 0; bottom: 0; z-index: 20; margin: 8px;
    width: min(380px, calc(100vw - 16px)); height: auto; box-shadow: var(--shadow-float);
  }
}
/* On a phone the date gets a row of its own under the title and buttons. */
@media (max-width: 768px) {
  .header-content { flex-wrap: wrap; row-gap: 8px; }
  .header-actions { display: contents; }
  .brand { margin-right: auto; }
  .as-of { order: 99; flex: 1 0 100%; justify-content: space-between; }
  .as-of-field { flex: 1; justify-content: center; }
  #today-toggle { width: 44px; height: 44px; }
}
