/* Global base styles for the HC24 Portal
   - Keep global tweaks and small shared components here
   - Page-specific overrides belong in styles/pages/<view>.css
*/

html {
  scrollbar-gutter: stable;
}

/* Simple toggle switch (migrated from static/styles.css) */
.hc-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #d1d5db; /* gray-300 */
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  transition: background .2s ease;
  display: inline-block;
  vertical-align: middle;
}
.hc-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 9999px;
  transition: left .2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.hc-toggle:checked { background: #10b981; } /* emerald-500 */
.hc-toggle:checked::after { left: 20px; }

/* Top navigation + header layout */
.app-header {
  --app-header-control-height: 44px;
  width: 100%;
  background: var(--bg-card, #ffffff);
  border-bottom: 1px solid var(--border, rgba(15,23,42,0.08));
  box-shadow: 0 1px 0 rgba(15,23,42,0.06);
}
.app-header__inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: clamp(0.75rem, 1.5vw, 1.75rem);
  padding: clamp(0.75rem, 1.5vw, 1.1rem) clamp(1rem, 4vw, 3rem);
}
.app-header__cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-width: 0;
}
.app-header__cluster--left { justify-content: flex-start; }
.app-header__cluster--right { justify-content: flex-end; }
.app-header__center {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}
.app-header__center .app-menu {
  flex: 0 0 auto;
}
.header-search {
  --search-border: rgba(15, 23, 42, 0.12);
  --search-bg: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.95));
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--search-border);
  background: var(--search-bg);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  min-height: var(--app-header-control-height);
  flex: 1 1 320px;
  max-width: min(520px, 100%);
}
.header-search:focus-within {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.14);
}
.header-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--fg, #0f172a);
  width: 100%;
  min-width: 180px;
}
.header-search input::placeholder {
  color: rgba(15, 23, 42, 0.55);
}
.header-search__btn {
  width: var(--app-header-control-height);
  height: var(--app-header-control-height);
  border-radius: 999px;
  border: 1px solid var(--search-border);
  background: #0f172a;
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.header-search__btn:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
  transform: translateY(-1px);
}
.header-search__btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}
.header-search__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}
.header-search__btn svg {
  width: 1.05rem;
  height: 1.05rem;
}
.header-search.is-loading {
  opacity: 0.65;
  pointer-events: none;
}
.app-header__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  text-align: center;
  color: var(--fg, #0f172a);
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}
.app-header__brand-icon {
  width: 13px;
  height: 13px;
  object-fit: contain;
  flex: 0 0 auto;
}
.app-header__brand-text {
  line-height: 1;
}
.app-header__brand:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}
.app-header__cluster .btn,
.app-header__cluster .gi-round-btn,
.app-header__cluster .info-panel,
.app-header__cluster .health-panel,
.app-header__cluster .view-ctx-btn {
  min-height: var(--app-header-control-height);
}
.app-header__cluster .gi-round-btn {
  width: var(--app-header-control-height);
  height: var(--app-header-control-height);
}
.app-header__center .gi-round-btn {
  width: var(--app-header-control-height);
  height: var(--app-header-control-height);
}
.app-header__icon-btn {
  width: var(--app-header-control-height);
  height: var(--app-header-control-height);
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: radial-gradient(circle at 30% 20%, #f8fafc, #e2e8f0 60%, #e0e7ff);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.app-header__icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.18);
}
.app-header__icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 12px 24px rgba(15, 23, 42, 0.18);
}
.app-header__icon-btn svg {
  width: 20px;
  height: 20px;
}
.portal-chat-widget {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--app-header-control-height);
}
.portal-chat-toggle {
  min-height: var(--app-header-control-height);
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem 0.4rem 0.6rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.portal-chat-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
}
.portal-chat-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 12px 24px rgba(15, 23, 42, 0.18);
}
.portal-chat-toggle__lamp {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #9ca3af;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.28);
}
.portal-chat-toggle__lamp.is-online {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.24), 0 0 10px rgba(22, 163, 74, 0.45);
}
.portal-chat-toggle__lamp.is-unread-blink {
  animation: portal-chat-lamp-blink 1.8s ease-in-out infinite;
}
@keyframes portal-chat-lamp-blink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.86);
  }
}
.portal-chat-toggle__label {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
}
.portal-chat-toggle__count {
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.portal-chat-mini-users {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 200px;
  overflow: hidden;
}
.portal-chat-mini-user {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  padding: 0.16rem 0.48rem;
  font-size: 0.72rem;
  line-height: 1;
  color: rgba(15, 23, 42, 0.8);
  white-space: nowrap;
}
.portal-chat-mini-user__lamp {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
}
.portal-chat-panel[hidden] {
  display: none !important;
}
.portal-chat-panel {
  position: fixed;
  top: clamp(72px, 9vh, 118px);
  right: clamp(12px, 2vw, 28px);
  width: min(880px, calc(100vw - 28px));
  height: min(78vh, 700px);
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.24);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  z-index: 21000;
}
.portal-chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: move;
  user-select: none;
}
.portal-chat-panel__head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.portal-chat-panel__head-actions button {
  cursor: pointer;
}
.portal-chat-panel.is-dragging {
  transition: none !important;
}
.portal-chat-panel__active {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.portal-chat-panel__section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.6);
}
.portal-chat-active-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.portal-chat-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
}
.portal-chat-active-chip__lamp {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
}
.portal-chat-panel__create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.6rem;
}
.portal-chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.86);
}
.portal-chat-form label {
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.72);
}
.portal-chat-form input,
.portal-chat-form select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 10px;
  background: #fff;
  color: var(--fg, #0f172a);
  font-size: 0.85rem;
  padding: 0.42rem 0.55rem;
}
.portal-chat-form__row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.portal-chat-form__row select {
  flex: 1 1 auto;
}
.portal-chat-panel__layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 0.7rem;
  min-height: 0;
  flex: 1 1 auto;
}
.portal-chat-conversation-list {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #fff;
  overflow: auto;
  max-height: 420px;
}
.portal-chat-conversation {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 0.55rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.portal-chat-conversation:last-child {
  border-bottom: none;
}
.portal-chat-conversation:hover {
  background: rgba(148, 163, 184, 0.12);
}
.portal-chat-conversation.is-active {
  background: #0f172a;
  color: #e2e8f0;
}
.portal-chat-conversation__title {
  font-weight: 700;
  font-size: 0.86rem;
}
.portal-chat-conversation__meta {
  font-size: 0.72rem;
  opacity: 0.78;
}
.portal-chat-conversation__preview {
  font-size: 0.75rem;
  opacity: 0.86;
}
.portal-chat-messages-pane {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.portal-chat-messages {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #fff;
  padding: 0.6rem;
  overflow: auto;
  max-height: 420px;
  min-height: 280px;
}
.portal-chat-message {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.45rem;
}
.portal-chat-message:last-child {
  margin-bottom: 0;
}
.portal-chat-message__meta {
  font-size: 0.7rem;
  color: rgba(15, 23, 42, 0.68);
  margin-bottom: 0.2rem;
}
.portal-chat-message__body {
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.portal-chat-send {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.portal-chat-send input {
  flex: 1 1 auto;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 10px;
  background: #fff;
  color: var(--fg, #0f172a);
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
}
.portal-chat-panel__status {
  min-height: 1.1rem;
  font-size: 0.76rem;
  color: rgba(15, 23, 42, 0.7);
}
.portal-chat-panel__status.is-error {
  color: #b91c1c;
}
.portal-chat-empty {
  padding: 0.55rem;
  font-size: 0.78rem;
  color: rgba(15, 23, 42, 0.66);
}
.app-header__cluster .health-panel {
  --health-panel-height: var(--app-header-control-height);
  flex: 1 1 240px;
  min-width: 220px;
  max-width: min(320px, 100%);
}
.app-header__cluster .info-panel {
  min-height: var(--app-header-control-height);
  flex: 1 1 280px;
  min-width: 220px;
  max-width: min(360px, 100%);
}
.inquiry-indicator {
  position: relative;
  flex: 0 0 auto;
}
.inquiry-indicator__btn {
  width: var(--app-header-control-height);
  height: var(--app-header-control-height);
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: radial-gradient(circle at 30% 20%, #e0f2fe, #c7d2fe 65%, #bfdbfe);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  transition: box-shadow .2s ease, transform .2s ease;
  text-decoration: none;
}
.inquiry-indicator__btn:hover {
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
  transform: translateY(-1px);
}
.inquiry-indicator__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 10px 25px rgba(15, 23, 42, 0.18);
}
.inquiry-indicator__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.inquiry-indicator__count {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid #fff;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.4);
}
.inquiry-indicator__count.is-empty {
  background: rgba(15, 23, 42, 0.35);
  box-shadow: none;
}

.app-header__cluster--right .view-ctx {
  flex: 0 0 auto;
}
.app-header__cluster--right .view-ctx:not([hidden]) {
  display: flex;
  align-items: center;
}

.omni-search__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.omni-search__summary {
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.65);
}
.omni-search__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 420px;
  overflow: auto;
}
.omni-hit {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  color: inherit;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.omni-hit:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 12px 26px rgba(59, 130, 246, 0.18);
}
.omni-hit--inactive {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}
.omni-hit--deleted {
  border-color: #dc2626;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
}
.omni-hit__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.omni-hit__eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(15, 23, 42, 0.55);
  margin-bottom: 0.1rem;
}
.omni-hit__title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg, #0f172a);
}
.omni-hit__chip {
  background: #e0f2fe;
  color: #0f172a;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  font-size: 0.85rem;
}
.omni-hit__state {
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.omni-hit__state--inactive {
  background: #fef9c3;
  color: #854d0e;
  border-color: rgba(245, 158, 11, 0.35);
}
.omni-hit__state--deleted {
  background: #fee2e2;
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.45);
}
.omni-hit__subtitle {
  color: rgba(15, 23, 42, 0.7);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}
.omni-hit__url {
  font-size: 0.85rem;
  color: #2563eb;
  margin-top: 0.25rem;
  display: inline-block;
}
.omni-search__more {
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.7);
}

/* Password generator modal */
.password-generator__card {
  width: min(540px, 94vw);
}
.password-generator__close {
  margin-left: auto;
}
.password-generator {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.password-generator__preview {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(135deg, #e9f3ef, #f2f7f5);
  padding: 0.75rem 0.85rem;
}
.password-generator__preview-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.6);
}
.password-generator__preview-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.password-generator__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  flex: 1 1 auto;
  word-break: break-all;
}
.password-generator__actions {
  display: inline-flex;
  gap: 0.45rem;
  margin-left: auto;
}
.password-generator__icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.password-generator__icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}
.password-generator__icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 8px 18px rgba(37, 99, 235, 0.16);
}
.password-generator__icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.password-generator__icon-btn svg {
  width: 18px;
  height: 18px;
}
.password-generator__strength {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: #ecfdf5;
  color: #15803d;
}
.password-generator__strength[data-strength="medium"] {
  border-color: rgba(59, 130, 246, 0.35);
  background: #eff6ff;
  color: #1d4ed8;
}
.password-generator__strength[data-strength="strong"] {
  border-color: rgba(34, 197, 94, 0.45);
  background: #ecfdf5;
  color: #15803d;
}
.password-generator__strength[data-strength="very"] {
  border-color: rgba(16, 185, 129, 0.45);
  background: #ecfdf5;
  color: #047857;
}
.password-generator__strength[data-strength="weak"] {
  border-color: rgba(220, 38, 38, 0.4);
  background: #fef2f2;
  color: #b91c1c;
}
.password-generator__length-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-weight: 600;
}
.password-generator__length-input {
  width: 70px;
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  text-align: center;
}
.password-generator__range {
  width: 100%;
  accent-color: #2563eb;
}
.password-generator__options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.password-generator__option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}
.password-generator__option input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}
.password-generator__warning {
  font-size: 0.85rem;
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: #fffbeb;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
}

.virtual-agent-launcher {
  position: relative;
  margin-right: 0.35rem;
}
.virtual-agent-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.02));
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.virtual-agent-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.16);
}
.virtual-agent-btn__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #22c55e, #16a34a);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}
.virtual-agent-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  border-radius: 14px;
  padding: 0.6rem;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 50;
}
.virtual-agent-menu__item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), #f8fafc);
  color: #0f172a;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s ease, transform .12s ease;
}
.virtual-agent-menu__icon {
  font-size: 1rem;
  line-height: 1;
}
.virtual-agent-menu__item:hover {
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

.calculator-tool {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.calculator-text-analyzer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calculator-text-analyzer textarea {
  min-height: 74px;
  resize: vertical;
}

.calculator-layout {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.calculator-keypad {
  display: grid;
  gap: 0.28rem;
}

.calculator-keypad--digits {
  grid-template-columns: repeat(3, minmax(52px, 1fr));
  max-width: 198px;
}

.calculator-keypad--ops {
  grid-template-columns: 1fr;
  max-width: 62px;
  min-width: 52px;
}

.calc-key-spacer {
  min-height: 34px;
  border-radius: 8px;
  background: transparent;
}

.calculator-keypad--ops [data-role="calc-key-clear"] {
  font-weight: 700;
}

.calculator-keypad--digits [data-key="0"] {
  grid-column: 2;
}

.calculator-keypad--digits [data-key=","] {
  grid-column: 3;
}

.calculator-keypad--digits .calc-key-spacer {
  grid-column: 1;
}

.calculator-keypad--ops [data-key="+"] {
  min-height: 42px;
}

.calculator-keypad--ops [data-key="-"] {
  min-height: 40px;
}

.calculator-keypad--ops [data-key="*"],
.calculator-keypad--ops [data-key="/"] {
  min-height: 34px;
}

.calculator-keypad--ops [data-role="calc-key-clear"] {
  min-height: 34px;
}

.calculator-keypad {
  gap: 0.28rem;
}

.calculator-tool .calc-key-btn {
  min-height: 34px;
  padding: 0.3rem 0.4rem;
  line-height: 1;
  font-weight: 600;
}

.calculator-trace {
  margin: 0;
  min-height: 52px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #334155;
}

@media (max-width: 1024px) {
  .app-header__inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    row-gap: 0.75rem;
  }
  .app-header__center {
    justify-self: flex-start;
    justify-content: flex-start;
  }
  .app-header__brand { text-align: left; }
  .app-header__cluster--right {
    justify-content: flex-start;
  }
  .portal-chat-mini-users {
    display: none;
  }
  .portal-chat-panel {
    left: 12px;
    right: 12px;
    width: auto;
    top: max(64px, env(safe-area-inset-top, 0px) + 8px);
    height: min(82vh, 700px);
  }
  .portal-chat-panel__create {
    grid-template-columns: 1fr;
  }
  .portal-chat-panel__layout {
    grid-template-columns: 1fr;
  }
  .portal-chat-conversation-list,
  .portal-chat-messages {
    max-height: 280px;
  }
}

@media (max-width: 640px) {
  .header-search {
    flex: 1 1 100%;
    max-width: 100%;
    order: -1;
  }
  .header-search input {
    min-width: 0;
  }
  .portal-chat-toggle__label {
    display: none;
  }
  .portal-chat-toggle {
    padding-right: 0.5rem;
  }
  .portal-chat-panel {
    left: 8px;
    right: 8px;
    top: max(56px, env(safe-area-inset-top, 0px) + 6px);
    height: min(84vh, 700px);
    padding: 0.65rem;
    border-radius: 12px;
  }
  .portal-chat-panel__head {
    flex-wrap: wrap;
  }
  .portal-chat-panel__head-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .calculator-keypad {
    max-width: 100%;
  }
  .calculator-layout {
    flex-direction: column;
  }
  .calculator-keypad--digits {
    grid-template-columns: repeat(3, minmax(46px, 1fr));
    max-width: 100%;
  }
  .calculator-keypad--ops {
    grid-template-columns: repeat(5, minmax(46px, 1fr));
    max-width: 100%;
    min-width: 0;
  }
  .calculator-keypad--ops [data-key="+"] {
    min-height: 34px;
  }
}
