.session-settings {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 16px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-primary, #e3e3e3);
  text-align: left;
  font:
    500 12px Inter,
    "Segoe UI",
    sans-serif;
  cursor: pointer;
}
.session-settings i {
  color: var(--color-text-tertiary, #a1a1aa);
}
.session-settings:hover {
  background: var(--color-bg-hover, #27272a);
}
.session-usage > span {
  margin-left: auto;
  font-size: 19px;
  line-height: 1;
}
.session-usage + .session-settings {
  margin-top: 4px;
}
.usage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
}
.usage-live-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pref-muted);
  font-size: 12px;
}
.usage-live-note > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pref-accent);
}
.usage-message {
  margin: 0 0 16px;
  color: var(--pref-muted);
  font-size: 13px;
  line-height: 1.65;
}
.usage-message:empty {
  display: none;
}
.usage-source {
  margin-bottom: 24px;
}
.usage-source-title {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.usage-source-note {
  padding: 12px 14px;
  border: 1px solid var(--pref-border);
  border-radius: 12px;
  color: var(--pref-muted);
  font-size: 12px;
  line-height: 1.65;
}
.usage-card {
  padding: 20px;
  margin-bottom: 14px;
  border: 1px solid var(--pref-border);
  border-radius: 16px;
  background: linear-gradient(140deg, var(--pref-soft), transparent 70%);
}
.usage-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.usage-model-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.usage-model-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  color: var(--pref-accent);
  background: var(--pref-soft);
}
.usage-progress {
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--pref-border);
}
.usage-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--pref-accent);
}
.usage-progress.is-low .usage-progress-fill {
  background: #d4a45b;
}
.usage-progress.is-full .usage-progress-fill {
  background: #d68181;
}
.usage-summary {
  margin: 10px 0 17px;
  color: var(--pref-muted);
  font-size: 12px;
  line-height: 1.5;
}
.usage-measure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--pref-border);
  font-size: 12px;
}
.usage-measure-label {
  min-width: 0;
}
.usage-value {
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.usage-window {
  display: block;
  margin-top: 5px;
  color: var(--pref-muted);
  font-size: 10px;
  line-height: 1.5;
  font-weight: 400;
}
.usage-updated,
.usage-card-footnote {
  margin: 8px 0 0;
  color: var(--pref-muted);
  font-size: 10px;
  line-height: 1.6;
}
.usage-toolbar button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.usage-toolbar button[aria-busy="true"] i {
  animation: auth-loader-turn 1.5s linear infinite;
}
@media (max-width: 420px) {
  .usage-card {
    padding: 16px;
  }
  .usage-measure {
    flex-wrap: wrap;
    gap: 8px;
  }
  .usage-value {
    margin-left: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .usage-toolbar button[aria-busy="true"] i {
    animation: none;
  }
}
.session-menu .session-logout {
  margin-top: 5px;
}
.preferences-dialog {
  --pref-surface: var(--color-bg-surface, #18181b);
  --pref-sidebar: var(--color-bg-body, #131315);
  --pref-text: var(--color-text-primary, #f4f4f5);
  --pref-muted: var(--color-text-tertiary, #a1a1aa);
  --pref-border: var(--color-border, #303034);
  --pref-accent: var(--color-accent, #a8c7fa);
  --pref-soft: var(--color-accent-soft, rgba(168, 199, 250, 0.08));
  --color-text: var(--pref-text);
  --color-bg: var(--pref-surface);
  width: min(920px, calc(100vw - 48px));
  height: min(650px, calc(100dvh - 64px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--pref-border);
  border-radius: 24px;
  background: var(--pref-surface);
  color: var(--pref-text);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.25);
  font-family: Inter, "Segoe UI", sans-serif;
}
.preferences-dialog::backdrop {
  background: rgba(10, 12, 16, 0.48);
  backdrop-filter: blur(4px);
}
body.dark-theme .preferences-dialog,
html[data-app-script^="/graph/"] .preferences-dialog {
  color-scheme: dark;
}
.preferences-dialog[open] {
  animation: preferences-in 0.18s ease-out;
}
.preferences-dialog *,
.preferences-dialog *::before,
.preferences-dialog *::after {
  box-sizing: border-box;
}
.preferences-dialog [hidden] {
  display: none !important;
}
.preferences-feedback {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: absolute;
  top: 105px;
  right: 24px;
  width: min(340px, calc(100% - 48px));
  z-index: 2;
  pointer-events: none;
}
.preferences-feedback > * {
  pointer-events: auto;
}
.preferences-feedback .custom-toast {
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
}
.preferences-feedback .custom-toast span {
  overflow-wrap: anywhere;
}
.preferences-dialog button,
.preferences-dialog select {
  font-family: inherit;
}
.preferences-dialog button {
  cursor: pointer;
}
.preferences-dialog button:focus-visible,
.preferences-dialog select:focus-visible {
  outline: 2px solid var(--pref-accent);
  outline-offset: 3px;
}
.preferences-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  height: 100%;
}
.preferences-sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 30px 14px 22px;
  border-right: 1px solid var(--pref-border);
  background: var(--pref-sidebar);
  min-height: 0;
}
.preferences-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  margin-bottom: 35px;
  font-size: 18px;
  letter-spacing: -0.5px;
}
.preferences-brand strong {
  font-weight: 600;
}
.preferences-brand-mark {
  color: var(--pref-accent);
  font-size: 24px;
  font-weight: 400;
}
.preferences-nav-label {
  margin: 0 14px 13px;
  color: var(--pref-muted);
  font-size: 9px;
  letter-spacing: 1.5px;
  font-weight: 500;
}
.preferences-tabs {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.preferences-tabs button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 43px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--pref-muted);
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
}
.preferences-tabs button i {
  width: 16px;
  text-align: center;
  font-size: 14px;
}
.preferences-tabs button:hover {
  color: var(--pref-text);
  background: var(--pref-soft);
}
.preferences-tabs button[aria-selected="true"] {
  color: var(--pref-accent);
  background: var(--pref-soft);
  border-color: var(--pref-soft);
}
.preferences-sidebar-note {
  margin: auto 14px 0;
  padding-top: 24px;
  color: var(--pref-muted);
  font-size: 10px;
  line-height: 1.6;
}
.preferences-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.preferences-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: auto;
  min-height: 99px;
  margin: 0;
  padding: 26px 34px 22px;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--pref-border);
  flex-shrink: 0;
  z-index: auto;
}
.preferences-kicker {
  margin: 0 0 7px;
  color: var(--pref-muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.3px;
}
.preferences-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.6px;
}
.preferences-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  color: var(--pref-muted);
  background: transparent;
  font-size: 17px;
}
.preferences-close:hover {
  background: var(--pref-soft);
  color: var(--pref-text);
}
.preferences-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px 34px;
  scrollbar-width: thin;
  scrollbar-color: var(--pref-border) transparent;
}
.preferences-section-heading {
  margin-bottom: 26px;
}
.preferences-section-heading h3 {
  margin: 0 0 9px;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -0.7px;
  font-weight: 600;
}
.preferences-section-heading p {
  margin: 0;
  color: var(--pref-muted);
  font-size: 12px;
  line-height: 1.8;
}
.preferences-group + .preferences-group {
  margin-top: 30px;
}
.preferences-group h4 {
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 600;
}
.preferences-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 18px 0;
  border-bottom: 1px solid var(--pref-border);
}
.preferences-row > div:first-child {
  min-width: 0;
}
.preferences-row label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.preferences-row p {
  margin: 5px 0 0;
  color: var(--pref-muted);
  font-size: 11px;
  line-height: 1.7;
}
.preferences-value {
  font-size: 11px;
  color: var(--pref-muted);
  overflow-wrap: anywhere;
  text-align: right;
  max-width: 55%;
}
.preferences-segmented {
  display: inline-flex;
  padding: 4px;
  gap: 3px;
  border: 1px solid var(--pref-border);
  border-radius: 11px;
  flex-shrink: 0;
}
.preferences-segmented button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  padding: 8px 12px;
  background: transparent;
  color: var(--pref-muted);
  font-size: 11px;
}
.preferences-segmented button[aria-pressed="true"] {
  background: var(--pref-soft);
  color: var(--pref-accent);
}
.preferences-theme-preview {
  display: flex;
  position: relative;
  height: 130px;
  padding: 16px;
  gap: 16px;
  margin-bottom: 28px;
  border: 1px solid var(--pref-border);
  border-radius: 16px;
  background: var(--pref-sidebar);
  overflow: hidden;
}
.preview-sidebar {
  width: 23%;
  padding: 14px 10px;
  border: 1px solid var(--pref-border);
  border-radius: 10px;
  background: var(--pref-surface);
}
.preview-sidebar span {
  display: block;
  height: 4px;
  width: 75%;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--pref-border);
}
.preview-sidebar span:first-child {
  width: 50%;
  background: var(--pref-accent);
  opacity: 0.7;
}
.preview-conversation {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 7px 2px;
  gap: 9px;
}
.preview-message {
  display: block;
  width: 70%;
  height: 16px;
  border-radius: 7px;
  background: var(--pref-border);
  opacity: 0.6;
}
.preview-message.short {
  width: 48%;
  background: var(--pref-soft);
  opacity: 1;
}
.preview-input {
  display: block;
  width: 100%;
  height: 24px;
  margin-top: auto;
  border: 1px solid var(--pref-border);
  border-radius: 8px;
  background: var(--pref-surface);
}
.preview-spark {
  position: absolute;
  right: 30px;
  top: 22px;
  color: var(--pref-accent);
  font-size: 24px;
}
.preferences-tip {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 21px 0 0;
  color: var(--pref-muted);
  font-size: 11px;
  line-height: 1.8;
}
.preferences-tip i {
  color: var(--pref-accent);
  margin-top: 4px;
}
.preferences-dialog #model-select {
  width: 190px;
  max-width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--pref-border);
  border-radius: 10px;
  background: var(--pref-surface);
  color: var(--pref-text);
  font-size: 12px;
  cursor: pointer;
}
.preferences-callout {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 20px;
  margin-top: 28px;
  border: 1px solid var(--pref-border);
  border-radius: 16px;
}
.preferences-callout-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--pref-soft);
  color: var(--pref-accent);
  font-size: 14px;
}
.preferences-callout strong {
  font-size: 12px;
  font-weight: 500;
}
.preferences-callout p {
  margin: 7px 0 10px;
  font-size: 11px;
  color: var(--pref-muted);
  line-height: 1.8;
}
.preferences-text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pref-accent);
  font-size: 11px;
}
.preferences-skill-note {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  padding: 13px 15px;
  background: var(--pref-soft);
  border-radius: 11px;
  color: var(--pref-muted);
  font-size: 11px;
  line-height: 1.8;
}
.preferences-skill-note i {
  margin-top: 4px;
  color: var(--pref-accent);
}
.preferences-skill-note strong {
  color: var(--pref-text);
  font-weight: 500;
}
.preferences-skills .modal-content {
  max-height: none;
  overflow: visible;
}
.preferences-skills #skills-list-container {
  max-height: none !important;
  overflow: visible !important;
}
.preferences-skills #skills-list-container > div {
  gap: 10px;
  flex-wrap: wrap;
}
.preferences-skills .modal-btn {
  width: 100%;
}
.preferences-refresh {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  color: var(--pref-muted);
  background: transparent;
}
.preferences-refresh:hover {
  background: var(--pref-soft);
  color: var(--pref-accent);
}
.preferences-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  margin-bottom: 27px;
  border: 1px solid var(--pref-border);
  border-radius: 16px;
}
.preferences-avatar {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  flex-shrink: 0;
  background: var(--pref-soft);
  color: var(--pref-accent);
  font-size: 18px;
  font-weight: 500;
}
.preferences-profile > div:nth-child(2) {
  min-width: 0;
}
.preferences-profile strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.preferences-profile .session-email {
  margin-top: 7px;
  font-size: 10px;
}
.preferences-status {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  margin-left: auto;
  color: var(--pref-muted);
  font-size: 9px;
}
.preferences-status > span {
  width: 5px;
  height: 5px;
  background: #65a88a;
  border-radius: 50%;
}
.preferences-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid var(--pref-border);
  border-radius: 10px;
  background: transparent;
  color: var(--pref-text);
  white-space: nowrap;
  font-size: 11px;
}
.preferences-action:hover {
  background: var(--pref-soft);
}
.preferences-action:disabled {
  opacity: 0.5;
  cursor: wait;
}
.preferences-graph-preview {
  padding: 5px 20px;
  margin-bottom: 25px;
  border: 1px solid var(--pref-border);
  border-radius: 16px;
  color: #3d424d;
  background: var(--pref-sidebar);
}
.preferences-graph-preview svg {
  display: block;
  width: 100%;
  height: 105px;
}
.preferences-switch {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 36px;
  height: 21px;
}
.preferences-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.preferences-switch > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: var(--pref-border);
  pointer-events: none;
  transition: background 0.15s;
}
.preferences-switch > span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--pref-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s;
}
.preferences-switch input:checked + span {
  background: var(--pref-accent);
}
.preferences-switch input:checked + span::after {
  transform: translateX(15px);
}
.preferences-switch input:focus-visible + span {
  outline: 2px solid var(--pref-accent);
  outline-offset: 3px;
}
.preferences-switch input:disabled + span {
  opacity: 0.5;
}
.preferences-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 14px;
  padding: 17px 34px;
  border-top: 1px solid var(--pref-border);
}
.preferences-footer > span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--pref-muted);
}
.preferences-footer > span i {
  color: var(--pref-accent);
  font-size: 9px;
}
.preferences-done {
  padding: 9px 20px;
  border: 1px solid var(--pref-border);
  border-radius: 9px;
  color: var(--pref-text);
  background: var(--pref-soft);
  font-size: 11px;
  font-weight: 500;
}
.preferences-done:hover {
  border-color: var(--pref-accent);
}
@keyframes preferences-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (max-width: 680px) {
  .preferences-dialog {
    width: calc(100vw - 24px);
    height: min(720px, calc(100dvh - 32px));
    border-radius: 20px;
  }
  .preferences-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .preferences-sidebar {
    padding: 14px 14px 11px;
    border-right: 0;
    border-bottom: 1px solid var(--pref-border);
  }
  .preferences-brand,
  .preferences-nav-label,
  .preferences-sidebar-note {
    display: none;
  }
  .preferences-tabs {
    flex-direction: row;
    overflow-x: auto;
    gap: 5px;
    scrollbar-width: none;
  }
  .preferences-tabs button {
    flex: 0 0 auto;
    width: auto;
    min-height: 37px;
    gap: 7px;
    padding: 9px 12px;
    font-size: 11px;
  }
  .preferences-tabs button i {
    font-size: 12px;
    width: auto;
  }
  .preferences-header {
    min-height: 86px;
    padding: 20px 22px;
  }
  .preferences-content {
    padding: 25px 22px;
  }
  .preferences-section-heading h3 {
    font-size: 20px;
  }
  .preferences-row {
    gap: 14px;
  }
  .preferences-footer {
    padding: 14px 22px;
  }
  .preferences-theme-preview {
    height: 110px;
  }
  .preferences-profile {
    flex-wrap: wrap;
    padding: 16px;
  }
  .preferences-status {
    width: 100%;
    margin-left: 57px;
  }
  .preferences-dialog #model-select {
    width: 160px;
  }
}
@media (max-width: 420px) {
  .preferences-row {
    flex-wrap: wrap;
  }
  .preferences-row > div:first-child {
    flex: 1 1 160px;
  }
  .preferences-value {
    max-width: 100%;
    text-align: left;
  }
  .preferences-segmented {
    margin-top: 4px;
  }
  .preferences-switch {
    margin-left: auto;
  }
  .preferences-content {
    padding: 22px 18px;
  }
  .preferences-footer {
    padding: 14px 18px;
  }
  .preferences-footer > span {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .preferences-dialog[open],
  .preferences-switch > span,
  .preferences-switch > span::after {
    animation: none;
    transition: none;
  }
}
