:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #090a10;
  color: #dce1ef;
  --bg: #090a10;
  --panel: #10121c;
  --panel-2: #151825;
  --line: #262b3d;
  --muted: #8791aa;
  --cyan: #61f4dd;
  --violet: #ad8aff;
  --white: #eff3ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 75% 0%, #492b7520, transparent 45%), var(--bg);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151824;
  color: #d8dfed;
  padding: 10px 15px;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}
button:hover {
  border-color: #59617f;
  background: #1d2130;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.primary {
  background: var(--cyan);
  color: #08211b;
  font-weight: 650;
  border-color: var(--cyan);
  box-shadow: 0 0 20px #61f4dd12;
}
.primary:hover {
  background: #a1ffed;
  border-color: #a1ffed;
}
.accent-button {
  background: #61f4dd0b;
  color: var(--cyan);
  border-color: #61f4dd45;
}
.accent-button:hover {
  background: #61f4dd18;
  border-color: var(--cyan);
}
input,
textarea,
select {
  background: #0c0e17;
  color: #e1e7f4;
  border: 1px solid #30364a;
  border-radius: 7px;
  padding: 11px 12px;
  outline: none;
}
input::placeholder,
textarea::placeholder {
  color: #6f7890;
}
textarea {
  line-height: 1.65;
  resize: vertical;
}
select {
  cursor: pointer;
}
label {
  display: block;
  color: #aab3c9;
  font-size: 12px;
}
label input,
label select,
label textarea {
  width: 100%;
  margin-top: 8px;
}
p {
  color: var(--muted);
  line-height: 1.8;
}
h1,
h2,
h3 {
  color: var(--white);
}
.eyebrow,
.section-label,
.metric-label {
  font:
    10px/1.5 Consolas,
    "Cascadia Code",
    monospace;
  letter-spacing: 1.8px;
}
.eyebrow {
  color: var(--cyan);
}
.section-label {
  color: #5d6781;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 9px #61f4dd60;
  margin-right: 7px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
kbd {
  font:
    10px Consolas,
    monospace;
  color: #6f7c94;
  border: 1px solid #30364b;
  border-radius: 4px;
  padding: 3px 5px;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: #343b53;
  border-radius: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
.app-sidebar {
  width: 218px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #10121b, #0c0e16);
  border-right: 1px solid #222637;
  padding: 28px 17px 18px;
  display: flex;
  flex-direction: column;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #e7edf9;
  padding: 0 5px;
  margin-bottom: 34px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--cyan);
  font-size: 27px;
  border: 1px solid #61f4dd55;
  border-radius: 8px;
  background: #61f4dd08;
  box-shadow: inset 0 0 12px #61f4dd08;
}
.brand > span:last-child {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.6px;
}
.brand small {
  display: block;
  font:
    7px Consolas,
    monospace;
  color: #697a91;
  letter-spacing: 1.3px;
  margin-top: 6px;
}
.new-chat {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #171c2a;
  border-color: #374055;
  padding: 12px;
  color: #dfe7f5;
  font-size: 12px;
}
.new-chat kbd {
  margin-left: auto;
}
.app-sidebar > .section-label {
  margin: 31px 11px 13px;
}
.app-sidebar nav {
  display: grid;
  gap: 5px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: transparent;
  border-color: transparent;
  font-size: 12px;
  padding: 12px 11px;
  color: #8793ad;
}
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  width: 20px;
  text-align: center;
}
.ui-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
button > .ui-icon,
a > .ui-icon {
  margin-right: 5px;
}
.voice-button > .ui-icon,
.icon-button > .ui-icon,
#logout > .ui-icon {
  margin: 0;
}
.nav-icon .ui-icon {
  transition:
    filter 0.2s ease,
    transform 0.2s ease;
}
.nav:hover .nav-icon .ui-icon,
.nav.active .nav-icon .ui-icon {
  filter: drop-shadow(0 0 5px #61f4dd50);
}
.nav:hover .nav-icon .ui-icon {
  transform: translateY(-1px);
}
.brand-mark .ui-icon,
.hero-orbit .ui-icon {
  filter: drop-shadow(0 0 8px #61f4dd40);
}
.tool-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.run-trace .ui-icon {
  margin-right: 6px;
}
.icon-spin {
  animation: icon-spin 1.2s linear infinite;
}
@keyframes icon-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .icon-spin {
    animation: none;
  }
  .nav-icon .ui-icon {
    transition: none;
  }
}
.nav.active {
  color: var(--cyan);
  background: #61f4dd0a;
  border-color: #61f4dd1a;
  box-shadow: inset 2px 0 var(--cyan);
}
.nav-arrow,
.nav-count {
  margin-left: auto;
}
.nav-count {
  font:
    10px Consolas,
    monospace;
  border: 1px solid #384052;
  border-radius: 4px;
  padding: 2px 5px;
  color: #adbad4;
}
.history-heading {
  margin-top: 36px !important;
}
#history {
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.history-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 11px;
  color: #8793a8;
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item::before {
  content: "↳";
  color: #49556e;
  margin-right: 8px;
}
.app-sidebar footer {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #23283a;
  padding: 20px 5px 0;
  margin-top: 18px;
}
.owner-avatar {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  border: 1px solid #ad8aff40;
  background: #ad8aff13;
  color: #bea2ff;
  display: grid;
  place-items: center;
  font:
    13px Consolas,
    monospace;
}
.app-sidebar footer b {
  font-size: 11px;
  font-weight: 500;
}
.app-sidebar footer small {
  display: block;
  font:
    7px Consolas,
    monospace;
  letter-spacing: 0.7px;
  color: #728196;
  margin-top: 7px;
}
.app-sidebar footer .dot {
  width: 4px;
  height: 4px;
  margin-right: 3px;
}
.app-sidebar footer button {
  padding: 5px;
  margin-left: auto;
}
main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.app-header {
  height: 70px;
  flex-shrink: 0;
  border-bottom: 1px solid #222738;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: #0b0d1490;
}
.breadcrumb {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 11px;
  color: #75829a;
  min-width: 0;
}
.breadcrumb b {
  font-weight: 450;
  color: #b9c4d7;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 450px;
}
.separator {
  color: #384357;
}
.badge {
  font:
    10px Consolas,
    "Microsoft YaHei",
    monospace;
  color: var(--cyan);
  padding: 7px 11px;
  border: 1px solid #61f4dd25;
  border-radius: 6px;
  white-space: nowrap;
  background: #61f4dd06;
}
.badge::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 7px;
}
.badge[data-ready="false"] {
  color: #e8c879;
}
#workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background-image:
    linear-gradient(#a7baff03 1px, transparent 1px),
    linear-gradient(90deg, #a7baff03 1px, transparent 1px);
  background-size: 42px 42px;
}
#chat-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
#welcome {
  margin: auto;
  padding: 44px 20px 30px;
  text-align: center;
  width: min(800px, 95%);
}
.hero-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 33px;
  border: 1px solid #61f4dd32;
  border-radius: 22px;
  transform: rotate(12deg);
  background: linear-gradient(145deg, #61f4dd08, #ad8aff0c);
  box-shadow:
    0 0 65px #ad8aff13,
    inset 0 0 24px #61f4dd05;
}
.hero-orbit::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid #ad8aff38;
  border-radius: 14px;
}
.hero-orbit span {
  font-size: 49px;
  color: var(--cyan);
  transform: rotate(-12deg);
  text-shadow: 0 0 18px #61f4dd50;
}
#welcome h1 {
  font-size: clamp(30px, 3.2vw, 45px);
  letter-spacing: -1.5px;
  font-weight: 600;
  margin: 17px 0 19px;
}
#welcome h1 span {
  background: linear-gradient(90deg, var(--cyan), #aaadff);
  color: transparent;
  background-clip: text;
}
#welcome p {
  font-size: 13px;
  line-height: 2;
}
.hero-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  color: #8190a8;
  font-size: 10px;
  margin-top: 26px;
}
.hero-divider {
  height: 10px;
  width: 1px;
  background: #364158;
  margin: 0 12px;
}
.composer {
  width: min(840px, calc(100% - 64px));
  margin: 17px auto 22px;
  flex-shrink: 0;
}
.composer form {
  border: 1px solid #38455a;
  border-radius: 13px;
  background: linear-gradient(120deg, #171b27, #121620);
  padding: 15px 17px;
  box-shadow: 0 6px 40px #0003;
}
.composer form:focus-within {
  border-color: #61f4dd65;
  box-shadow:
    0 0 0 1px #61f4dd12,
    0 6px 40px #0003;
}
.composer textarea {
  border: 0;
  background: transparent;
  width: 100%;
  resize: none;
  max-height: 160px;
  padding: 0;
  color: #e2e8f5;
  font-size: 13px;
}
.composer textarea:focus-visible {
  outline: none;
}
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.composer-bottom > span {
  color: #7c89a1;
  font-size: 10px;
}
.composer-spark {
  color: var(--violet);
  font-size: 15px;
  margin-right: 4px;
}
.composer .primary {
  font-size: 12px;
  padding: 9px 15px;
}
.composer .primary span {
  margin-left: 14px;
}
.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.voice-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #36505b;
  background: #12212b;
  color: #b6e9ec;
  cursor: pointer;
  flex-shrink: 0;
}
.voice-button:hover {
  border-color: #63e4eb;
  background: #1d3442;
}
.voice-button:disabled {
  opacity: 0.4;
  cursor: default;
}
.voice-done {
  background: #59d9df;
  color: #07161c;
  font-size: 22px;
}
.dictation-controls {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dictation-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b6e9ec;
  font-size: 13px;
}
.dictation-status > span {
  color: #63e4eb;
}
.dictation-status time {
  font-variant-numeric: tabular-nums;
  color: #8ca0ae;
}
.dictation-preview {
  margin-top: 12px;
  max-height: 100px;
  overflow: auto;
  color: #aebfce;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.dictation-error {
  margin-top: 10px;
  font-size: 13px;
  color: #ffb8bc;
}
.voice-pulse {
  animation: voice-pulse 1.2s ease-in-out infinite;
}
@keyframes voice-pulse {
  50% {
    opacity: 0.3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .voice-pulse {
    animation: none;
  }
}
.composer > small {
  display: block;
  text-align: center;
  color: #59647b;
  font-size: 9px;
  margin-top: 12px;
}
#messages {
  width: min(800px, calc(100% - 72px));
  margin: 30px auto 0;
}
#messages:empty {
  display: none;
}
.message {
  margin-bottom: 31px;
  overflow-wrap: anywhere;
  line-height: 1.85;
  font-size: 13px;
}
.message-label {
  font:
    9px Consolas,
    monospace;
  letter-spacing: 1.8px;
  color: var(--cyan);
  margin-bottom: 12px;
}
.message.user {
  margin-left: 16%;
  background: #161d2c;
  border: 1px solid #303b51;
  padding: 16px 20px;
  border-radius: 12px 12px 3px 12px;
}
.message.user .message-label {
  color: #8d9fba;
}
.message.user .message-body {
  white-space: pre-wrap;
}
.message.assistant {
  padding: 5px 0;
}
.message-body p {
  color: #c1cbdc;
  margin: 0 0 13px;
}
.message-body strong {
  color: #f0f6ff;
}
.message-body ul,
.message-body ol {
  padding-left: 23px;
  color: #c1cbdc;
}
.message-body a {
  color: var(--cyan);
  text-decoration-color: #61f4dd50;
}
.message-body code {
  font:
    12px Consolas,
    monospace;
  background: #1c2336;
  padding: 2px 5px;
  border-radius: 4px;
  color: #bfa6ff;
}
.message-body pre {
  background: #101622;
  border: 1px solid #2c354b;
  padding: 16px;
  overflow: auto;
  border-radius: 8px;
}
.message-body pre code {
  padding: 0;
  background: transparent;
  color: #bcccdc;
}
.message-body table {
  border-collapse: collapse;
  width: 100%;
  display: block;
  overflow: auto;
  font-size: 12px;
}
.message-body th,
.message-body td {
  padding: 10px 14px;
  border: 1px solid #30384d;
  text-align: left;
}
.message-body th {
  background: #192031;
}
.message-body.error {
  color: #ff9da8;
  background: #ff6a800a;
  border: 1px solid #ff6a8030;
  padding: 12px 15px;
  border-radius: 8px;
}
.run-trace {
  color: #7d8da7;
  border: 1px solid #2a3547;
  border-radius: 7px;
  padding: 8px 12px;
  margin: 0 0 14px;
  font-size: 10px;
  background: #111823;
}
.run-trace summary {
  cursor: pointer;
  color: #88a6a5;
}
.run-trace div {
  padding-top: 7px;
}
.run-trace .failed {
  color: #ff9da8;
}
#tools-workspace {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 32px 34px 36px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1560px;
  margin: 0 auto 24px;
}
.page-heading h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 8px 0;
}
.heading-dot {
  color: var(--cyan);
  margin-left: 2px;
}
.page-heading p {
  font-size: 12px;
  margin: 0;
}
.heading-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.heading-actions .primary {
  font-size: 12px;
}
.icon-button {
  padding: 9px 12px;
  font-size: 18px;
  line-height: 1;
  background: transparent;
}
.library-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.3fr;
  max-width: 1560px;
  margin: 0 auto 28px;
  border: 1px solid #2a3043;
  border-radius: 10px;
  background: linear-gradient(115deg, #141827, #11141e);
  overflow: hidden;
}
.library-summary > div {
  padding: 17px 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 13px;
  align-items: baseline;
  border-right: 1px solid #272e40;
}
.library-summary > div:last-child {
  border: 0;
}
.metric-label {
  grid-column: 1/-1;
  color: #6b7894;
  font-size: 8px;
}
.library-summary strong {
  font:
    27px/1.2 Consolas,
    monospace;
  color: #dce9fc;
}
.library-summary > div:nth-child(2) strong {
  color: var(--cyan);
}
.library-summary > div:nth-child(3) strong {
  color: var(--violet);
}
.library-summary > div > span:last-child {
  font-size: 10px;
  color: #76859f;
}
.storage-summary b {
  font-size: 12px;
  font-weight: 500;
  color: #b9c5db;
  grid-column: 1/-1;
}
.storage-summary > span:last-child {
  grid-column: 1/-1;
}
.tools-browser {
  display: grid;
  grid-template-columns: 175px 1fr;
  gap: 27px;
  max-width: 1560px;
  margin: 0 auto;
}
.category-panel {
  padding-top: 7px;
  background: transparent;
  align-self: start;
  position: sticky;
  top: 0;
}
.category-panel .section-label {
  margin: 0 12px 14px;
}
.category-panel nav {
  display: grid;
  gap: 5px;
}
.category-button {
  display: flex;
  align-items: center;
  gap: 10px;
  border-color: transparent;
  text-align: left;
  background: transparent;
  font-size: 11px;
  color: #8796b0;
  padding: 11px 12px;
}
.category-button .category-icon {
  width: 16px;
  color: #5f708e;
  font-size: 15px;
}
.category-button .category-count {
  font:
    10px Consolas,
    monospace;
  margin-left: auto;
  color: #596b86;
}
.category-button.active {
  background: #ad8aff10;
  border-color: #ad8aff28;
  color: #c4adff;
}
.category-button.active .category-icon,
.category-button.active .category-count {
  color: #bea0ff;
}
.library-content {
  min-width: 0;
}
.library-filters {
  display: flex;
  gap: 12px;
  align-items: center;
}
.search-field {
  display: flex;
  align-items: center;
  flex: 1;
  border: 1px solid #30384d;
  background: #101420;
  border-radius: 8px;
  padding: 0 13px;
}
.search-field > span {
  font-size: 22px;
  color: #687d98;
}
.search-field input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  font-size: 11px;
  padding: 13px 10px;
  margin: 0;
}
.search-field:focus-within {
  border-color: #61f4dd70;
}
.search-field input:focus-visible {
  outline: none;
}
.search-field kbd {
  margin-left: 7px;
}
.library-filters select {
  font-size: 11px;
  width: 118px;
  min-height: 43px;
  background: #111521;
}
.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 14px;
}
.results-heading h2 {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  color: #d4dcee;
}
.results-heading > span {
  font:
    9px Consolas,
    "Microsoft YaHei",
    monospace;
  color: #60728c;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 13px;
  align-items: stretch;
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-height: 176px;
  background: linear-gradient(135deg, #151928, #11151f);
  border: 1px solid #2b3247;
  padding: 18px;
  border-radius: 9px;
  position: relative;
  overflow: hidden;
}
.tool-card:hover {
  border-color: #61f4dd65;
  transform: translateY(-2px);
  background: linear-gradient(135deg, #182233, #121b25);
  box-shadow: 0 8px 23px #0003;
}
.tool-card::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 16px;
  height: 16px;
  background: linear-gradient(225deg, #61f4dd18 50%, transparent 50%);
}
.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 17px;
}
.tool-glyph {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #61f4dd28;
  border-radius: 7px;
  background: #61f4dd08;
  color: var(--cyan);
  font-size: 19px;
}
.tool-card[data-category="technical"] .tool-glyph,
.tool-card[data-category="knowledge"] .tool-glyph {
  color: var(--violet);
  background: #ad8aff08;
  border-color: #ad8aff30;
}
.tool-status {
  font-size: 9px;
  color: #93b7ab;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tool-status::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #61f4dd;
}
.tool-status.disabled {
  color: #7c8ba3;
}
.tool-status.disabled::before {
  background: #65758b;
}
.tool-status.draft {
  color: #b5a0db;
}
.tool-status.draft::before {
  background: #b593fc;
}
.tool-card h3 {
  font-size: 13px;
  font-weight: 550;
  margin: 0 0 8px;
  color: #dbe4f4;
  line-height: 1.5;
}
.tool-card p {
  font-size: 10px;
  line-height: 1.75;
  margin: 0 0 17px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #7e8ba4;
  min-height: 35px;
}
.tool-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  color: #6d7f9d;
  font-size: 9px;
}
.language-tag {
  font:
    8px Consolas,
    monospace;
  letter-spacing: 0.4px;
  padding: 3px 6px;
  border: 1px solid #35405a;
  border-radius: 4px;
  color: #9ba8c3;
}
.tool-card-arrow {
  margin-left: auto;
  color: #586a88;
  font-size: 17px;
}
#tool-empty {
  padding: 60px 20px;
  text-align: center;
  border: 1px dashed #30384c;
  border-radius: 10px;
}
#tool-empty > span {
  font-size: 35px;
  color: var(--violet);
}
#tool-empty h2 {
  font-size: 16px;
  font-weight: 500;
}
#tool-empty p {
  font-size: 12px;
}
#library-feedback {
  font-size: 12px;
  color: #ffafba;
}
dialog {
  border: 1px solid #38425a;
  border-radius: 12px;
  background: #111521;
  color: #d9e3f3;
  width: min(500px, 90vw);
  padding: 28px;
  box-shadow: 0 20px 90px #0008;
}
dialog::backdrop {
  background: #060910ad;
  backdrop-filter: blur(4px);
}
.tool-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(580px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  border-radius: 0;
  border: 0;
  border-left: 1px solid #64708960;
  padding: 0;
  box-shadow: -20px 0 100px #0008;
}
.tool-drawer[open] {
  display: flex;
  flex-direction: column;
}
.drawer-header {
  padding: 25px 26px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid #293247;
  background: linear-gradient(120deg, #182036, #151923);
}
.drawer-header h2 {
  font-size: 22px;
  font-weight: 550;
  margin: 9px 0 0;
  line-height: 1.4;
}
#tool-fields {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.detail-tabs {
  display: flex;
  gap: 9px;
  padding: 0 23px;
  border-bottom: 1px solid #2b3347;
  background: #121725;
}
.detail-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 16px 12px;
  font-size: 12px;
  color: #7688a5;
}
.detail-tabs button.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}
.drawer-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 24px 27px 30px;
}
.detail-badges {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
}
.detail-badges span {
  font-size: 10px;
  padding: 5px 9px;
  border: 1px solid #344159;
  border-radius: 5px;
  color: #99b0ce;
}
.detail-badges span.enabled {
  color: var(--cyan);
  border-color: #61f4dd40;
  background: #61f4dd0a;
}
#detail-description {
  font-size: 13px;
  color: #a2b1ca;
  line-height: 1.9;
}
.detail-section {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid #293247;
}
.detail-section h3 {
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 13px;
}
.detail-section p {
  font-size: 12px;
}
.parameter-row {
  padding: 11px 0;
  border-bottom: 1px solid #222c40;
  font-size: 12px;
}
.parameter-row code {
  font:
    11px Consolas,
    monospace;
  color: var(--cyan);
}
.parameter-row > span {
  font:
    9px Consolas,
    "Microsoft YaHei",
    monospace;
  color: #8799b9;
  margin-left: 10px;
}
.parameter-row p {
  font-size: 11px;
  margin: 7px 0 0;
}
.parameter-row .required {
  color: #ba9cf2;
}
.overview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.overview-controls h3 {
  width: 100%;
  margin-bottom: 0;
}
#tool-state {
  color: #859db5;
  font-size: 10px;
  flex: 1;
}
.drawer-footer {
  padding: 15px 26px;
  border-top: 1px solid #2b344a;
  background: #121927;
  min-height: 51px;
  font-size: 11px;
  color: #9bb6bd;
}
.tool-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.drawer-body label {
  margin-bottom: 17px;
}
.code-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.code-label label {
  margin-bottom: 10px;
}
#tool-contract {
  font:
    9px Consolas,
    monospace;
  color: #717f9e;
}
.code-input {
  display: block;
  width: 100%;
  font:
    12px/1.75 Consolas,
    "Cascadia Code",
    monospace;
  background: #0c101a;
  color: #b8d4d9;
  tab-size: 4;
}
.schema-section,
.ai-code-section {
  margin-top: 17px;
  border: 1px solid #2c374d;
  border-radius: 7px;
  padding: 12px;
}
.schema-section summary,
.ai-code-section summary {
  cursor: pointer;
  font-size: 11px;
  color: #a3b3ce;
}
.schema-section textarea,
.ai-code-section textarea {
  margin-top: 14px;
  width: 100%;
}
.editor-actions {
  display: flex;
  gap: 9px;
  margin: 19px 0;
}
.editor-actions button {
  font-size: 11px;
}
.ai-code-section button {
  margin-top: 10px;
}
.publish-panel {
  border: 1px solid #61f4dd24;
  padding: 20px;
  border-radius: 9px;
  background: #61f4dd04;
}
.publish-panel p {
  font-size: 11px;
}
#tool-input {
  margin: 12px 0 15px;
}
#tool-result,
#tool-ai-diff {
  white-space: pre-wrap;
  overflow: auto;
  max-height: 360px;
  padding: 15px;
  border: 1px solid #303b52;
  border-radius: 7px;
  background: #0a101a;
  color: #a8cecd;
  font:
    11px/1.75 Consolas,
    monospace;
}
#tool-ai-diff {
  white-space: pre;
  color: #bca8e1;
}
#tool-ai-summary {
  font-size: 11px;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-header h2 {
  font-size: 22px;
  margin: 8px 0;
}
.settings-header .icon-button {
  border: 0;
}
#settings p {
  font-size: 12px;
}
#settings label {
  margin-top: 22px;
}
.connection-note {
  font-size: 11px;
  color: #8aabac;
  border-top: 1px solid #303a51;
  padding-top: 20px;
  margin-top: 25px;
}
.muted {
  color: #6a7d9d;
}
.auth-loading {
  margin: 48px;
  color: var(--muted);
}
#login {
  margin: auto;
  width: min(390px, 90%);
}
#login h1 {
  font-size: 35px;
}
#login p {
  font-size: 13px;
}
#login button {
  width: 100%;
  margin-top: 12px;
}
#login input {
  width: 100%;
  margin-top: 14px;
}
@media (min-width: 1600px) {
  .app-sidebar {
    width: 240px;
  }
  #tools-workspace {
    padding: 38px 46px;
  }
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  }
}
@media (max-width: 1100px) {
  .app-sidebar {
    width: 190px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .tools-browser {
    grid-template-columns: 145px 1fr;
    gap: 18px;
  }
  #tools-workspace {
    padding: 25px 22px;
  }
  .library-summary > div {
    padding: 16px;
  }
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .storage-summary {
    display: none !important;
  }
  .library-summary {
    grid-template-columns: repeat(3, 1fr);
  }
  .library-summary > div:nth-child(3) {
    border: 0;
  }
}
@media (max-width: 760px) {
  .app-sidebar {
    width: 68px;
    padding: 22px 8px;
  }
  .brand {
    padding: 0;
    justify-content: center;
    margin-bottom: 25px;
  }
  .brand > span:last-child,
  .new-chat span,
  .new-chat kbd,
  .section-label.history-heading,
  #history,
  .app-sidebar > .section-label,
  .app-sidebar footer,
  .nav > span:not(.nav-icon) {
    display: none;
  }
  .brand-mark {
    width: 35px;
  }
  .new-chat {
    justify-content: center;
    font-size: 21px;
    padding: 7px;
  }
  .app-sidebar nav {
    margin-top: 22px;
  }
  .nav {
    justify-content: center;
    padding: 13px 6px;
  }
  .nav-icon {
    font-size: 21px;
  }
  .app-header {
    height: 61px;
    padding: 0 17px;
  }
  .breadcrumb {
    gap: 8px;
    font-size: 10px;
  }
  .breadcrumb b {
    max-width: 130px;
  }
  .badge {
    font-size: 8px;
    padding: 6px 8px;
  }
  #tools-workspace {
    padding: 23px 17px;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .heading-actions {
    gap: 5px;
    margin-top: 18px;
  }
  .heading-actions .primary {
    font-size: 10px;
    padding: 10px;
  }
  .heading-actions .icon-button {
    display: none;
  }
  .library-summary {
    margin-bottom: 21px;
  }
  .library-summary > div {
    padding: 13px 10px;
    gap: 6px;
  }
  .library-summary strong {
    font-size: 23px;
  }
  .library-summary .metric-label {
    font-size: 7px;
  }
  .library-summary > div > span:last-child {
    font-size: 8px;
  }
  .tools-browser {
    display: block;
  }
  .category-panel {
    position: static;
    margin-bottom: 18px;
  }
  .category-panel .section-label {
    display: none;
  }
  .category-panel nav {
    display: flex;
    overflow: auto;
    gap: 7px;
    padding-bottom: 5px;
  }
  .category-button {
    flex-shrink: 0;
    white-space: nowrap;
    border: 1px solid #293247;
    padding: 9px;
    font-size: 10px;
  }
  .category-button .category-icon {
    display: none;
  }
  .category-button .category-count {
    margin-left: 5px;
  }
  .library-filters {
    gap: 8px;
  }
  .library-filters select {
    width: 96px;
    font-size: 10px;
  }
  .search-field {
    padding: 0 9px;
  }
  .search-field input {
    font-size: 10px;
    padding: 11px 7px;
  }
  .search-field kbd {
    display: none;
  }
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
  }
  .tool-card {
    padding: 15px;
    min-height: 170px;
  }
  .composer {
    width: calc(100% - 30px);
    margin-bottom: 14px;
  }
  .composer-bottom > span {
    font-size: 8px;
  }
  .composer form {
    padding: 13px;
  }
  .composer textarea {
    font-size: 12px;
  }
  #messages {
    width: calc(100% - 34px);
  }
  #welcome {
    padding: 35px 10px;
  }
  #welcome h1 {
    font-size: 28px;
    letter-spacing: -0.8px;
  }
  #welcome p {
    font-size: 11px;
  }
  .hero-status {
    font-size: 8px;
  }
  .hero-divider {
    margin: 0 7px;
  }
  .hero-orbit {
    width: 69px;
    height: 69px;
  }
  .hero-orbit span {
    font-size: 39px;
  }
  .drawer-header {
    padding: 21px;
  }
  .drawer-body {
    padding: 20px;
  }
  .drawer-header h2 {
    font-size: 20px;
  }
  .tool-fields-row {
    grid-template-columns: 1fr;
  }
  .detail-tabs {
    padding: 0 10px;
  }
  .detail-tabs button {
    font-size: 11px;
    padding: 14px 11px;
  }
  .drawer-footer {
    padding: 14px 20px;
  }
  .tool-card p {
    -webkit-line-clamp: 3;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .tool-card:hover {
    transform: none;
  }
}
.tool-card h3 {
  font-size: 14px;
}
.tool-card p {
  font-size: 11px;
  line-height: 1.8;
  color: #8d9bb3;
}
.category-button {
  font-size: 12px;
}
.library-filters select,
.search-field input {
  font-size: 12px;
}
.tool-status {
  font-size: 10px;
}
.language-tag {
  font-size: 9px;
}
.nav {
  font-size: 13px;
}
.history-item {
  font-size: 12px;
}
@media (max-width: 760px) {
  .category-button {
    font-size: 11px;
  }
  .search-field input,
  .library-filters select {
    font-size: 11px;
  }
  .tool-card h3 {
    font-size: 13px;
  }
  .tool-card p {
    font-size: 11px;
  }
}

#root {
  display: flex;
  width: 100%;
  height: 100dvh;
  min-width: 0;
}
.app-error {
  color: #ff9fae;
  padding: 12px 24px;
}

/* Investment workspaces share the assistant's dark grid and accent palette. */
.investment-page {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  padding: 32px;
  scrollbar-gutter: stable;
}
.investment-page .page-heading {
  margin-bottom: 26px;
}
.investment-page .page-heading h1 {
  font-size: 34px;
  margin: 9px 0;
}
.investment-page .page-heading p {
  font-size: 13px;
}
.investment-page button {
  font-size: 12px;
}
.investment-page .eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
}
.investment-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1019;
  padding: 4px;
  gap: 3px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 8px 15px;
  color: var(--muted);
  white-space: nowrap;
}
.segmented button.active {
  color: var(--cyan);
  background: #61f4dd10;
  box-shadow: inset 0 0 0 1px #61f4dd26;
}
.small {
  font-size: 11px;
  line-height: 1.7;
}
.positive {
  color: var(--cyan) !important;
}
.negative {
  color: #f4849d !important;
}
.mono {
  font-family: "Consolas", monospace;
}
.portfolio-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 20px;
  margin-bottom: 24px;
}
.portfolio-capital {
  background: linear-gradient(125deg, #142925a0, #121621 65%);
  border: 1px solid #61f4dd30;
  border-radius: 12px;
  padding: 27px;
  position: relative;
  overflow: hidden;
}
.portfolio-capital .eyebrow {
  color: #a9beb9;
}
.capital-value {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 650;
  color: var(--white);
  letter-spacing: -1px;
  margin: 19px 0 12px;
}
.portfolio-capital p {
  margin: 0;
  font-size: 12px;
}
.capital-decoration {
  position: absolute;
  right: 18px;
  top: 14px;
  font-size: 110px;
  color: #61f4dd0c;
  transform: rotate(-12deg);
  pointer-events: none;
}
.investment-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.investment-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #121522;
  padding: 17px 20px;
  min-width: 0;
}
.investment-stat > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 11px;
}
.investment-stat strong {
  display: block;
  font-size: 21px;
  letter-spacing: -0.3px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.investment-stat small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 7px;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 20px;
  align-items: start;
}
.portfolio-main,
.portfolio-aside {
  min-width: 0;
}
.investment-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 22px;
  min-width: 0;
  margin-bottom: 20px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-heading h2 {
  font-size: 16px;
  margin: 7px 0 0;
  font-weight: 600;
}
.panel-heading .eyebrow {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 1.6px;
}
.investment-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 18px;
  margin: 0 0 18px;
  overflow-x: auto;
}
.investment-tabs button {
  border: 0;
  border-radius: 0;
  padding: 12px 0;
  color: var(--muted);
  background: none;
  white-space: nowrap;
  position: relative;
}
.investment-tabs button.active {
  color: var(--cyan);
  box-shadow: inset 0 -2px var(--cyan);
}
.investment-tabs button span {
  padding: 2px 6px;
  border-radius: 4px;
  background: #61f4dd15;
  margin-left: 8px;
  font-size: 10px;
}
.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.table-toolbar .search-field {
  max-width: 250px;
}
.table-toolbar select {
  font-size: 11px;
  padding: 8px 10px;
}
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.investment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
.investment-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.investment-table td {
  padding: 15px 10px;
  border-bottom: 1px solid #232839;
  vertical-align: middle;
}
.investment-table tr:last-child td {
  border-bottom: 0;
}
.investment-table tbody tr:hover {
  background: #ad8aff05;
}
.investment-table td small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.ticker {
  font-family: "Consolas", monospace;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
}
.table-link {
  color: var(--cyan);
  background: transparent;
  border: 0;
  padding: 5px 0;
  white-space: nowrap;
  font-size: 11px;
}
.table-link:hover {
  background: transparent;
  color: var(--white);
}
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  margin-top: 18px;
  gap: 12px;
}
.table-pagination > div {
  display: flex;
  gap: 10px;
  align-items: center;
}
.table-pagination button {
  padding: 4px 10px;
}
.allocation-chart {
  width: 175px;
  margin: 5px auto 20px;
}
.allocation-chart svg {
  width: 100%;
}
.donut-number {
  fill: var(--white);
  font-size: 28px;
  font-weight: 600;
}
.donut-label {
  fill: var(--muted);
  font-size: 8px;
  letter-spacing: 1px;
}
.allocation-legend {
  display: grid;
  gap: 13px;
  font-size: 11px;
}
.allocation-legend > div {
  display: flex;
  justify-content: space-between;
}
.allocation-legend span {
  display: flex;
  align-items: center;
  gap: 10px;
}
.allocation-legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}
.allocation-legend b {
  font-weight: 500;
}
.watch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.watch-chip {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #161a29;
}
.watch-chip button {
  background: transparent;
  border: 0;
  padding: 7px 9px;
  font-family: "Consolas", monospace;
}
.watch-chip small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 5px;
}
.watch-add {
  display: flex;
  gap: 6px;
  margin-top: 18px;
}
.watch-add input {
  width: 100%;
  min-width: 0;
  font-size: 11px;
}
.watch-add button {
  padding: 7px 11px;
}
.watch-measurements > div {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
}
.resource-state {
  font-size: 12px;
  color: var(--muted);
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.resource-error {
  color: #f4849d;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.loading-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 1.5s ease infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.data-details {
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 13px;
  margin-top: 20px;
}
.data-details summary {
  cursor: pointer;
  padding: 5px 0;
}
.data-details pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow-y: auto;
  background: #0d1018;
  padding: 13px;
  border-radius: 6px;
  line-height: 1.6;
}
.ledger-form {
  background: #151a28;
  padding: 18px;
  border: 1px solid #ad8aff40;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}
.ledger-form label,
.valuation-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}
.ledger-form input,
.ledger-form select {
  width: 100%;
  font-size: 12px;
}
.ledger-intro {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.ledger-intro b {
  color: var(--white);
}
.ledger-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}
.investment-confirm {
  max-width: 560px;
  width: calc(100% - 32px);
  border: 1px solid #ad8aff60;
  border-radius: 14px;
  background: var(--panel);
  color: var(--white);
  padding: 28px;
  max-height: 85dvh;
  overflow-y: auto;
}
.investment-confirm::backdrop {
  background: #05060bd9;
  backdrop-filter: blur(5px);
}
.observation-grid {
  margin: 15px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  font-size: 12px;
}
.observation-grid > div {
  border-bottom: 1px solid #232839;
  padding: 12px 0;
  min-width: 0;
}
.observation-grid dt {
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 7px;
}
.observation-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.analysis-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 22px;
}
.analysis-search > label {
  flex: 1;
  min-width: 0;
}
.analysis-search > label input {
  width: 100%;
  font-family: "Consolas", monospace;
  text-transform: uppercase;
  border: none;
  background: #0c0e16;
}
.analysis-config {
  position: relative;
  color: var(--muted);
  font-size: 11px;
}
.analysis-config summary {
  cursor: pointer;
  white-space: nowrap;
}
.analysis-config > div {
  position: absolute;
  right: 0;
  top: 30px;
  z-index: 5;
  width: 280px;
  background: #161a28;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
  box-shadow: 0 15px 30px #0009;
  display: grid;
  gap: 15px;
}
.analysis-config label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.analysis-config input,
.analysis-config select {
  width: 100%;
  font-size: 12px;
}
.analysis-empty {
  text-align: center;
  padding: 100px 20px;
  color: var(--muted);
}
.analysis-empty > div {
  color: var(--cyan);
  font-size: 70px;
  text-shadow: 0 0 25px #61f4dd30;
}
.analysis-empty h2 {
  color: var(--white);
  font-size: 24px;
  margin-top: 25px;
}
.analysis-empty p {
  font-size: 13px;
}
.stock-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 26px;
  align-items: center;
  margin: 25px 0;
}
.stock-symbol {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: 1px;
  font-family: "Consolas", monospace;
}
.stock-identity p {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 13px;
}
.stock-price {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 35px;
  font-weight: 600;
  margin-bottom: 9px;
}
.stock-price > span {
  font-size: 13px;
  background: #1b2430;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: 500;
}
.stock-identity > small {
  font-size: 10px;
}
.stock-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stock-quick-stats .investment-stat {
  background: transparent;
  padding: 16px;
}
.stock-quick-stats strong {
  font-size: 16px;
}
.level-strip {
  display: grid;
  grid-template-columns: 0.7fr 0.7fr 0.7fr 1.25fr 1.25fr;
  gap: 10px;
  margin-bottom: 20px;
}
.level-strip .investment-stat {
  padding: 15px 16px;
  background: #111520;
}
.level-strip strong {
  font-size: 17px;
}
.chart-panel {
  padding-bottom: 14px;
}
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 13px;
}
.chart-controls label {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.chart-controls select {
  padding: 6px 8px;
  font-size: 10px;
}
.chart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 12px;
}
.chart-toggles label {
  display: flex;
  align-items: center;
  gap: 5px;
}
.chart-toggles input {
  accent-color: var(--cyan);
  width: 12px;
  height: 12px;
}
.sma20-key {
  color: var(--violet);
}
.sma50-key {
  color: #ffd184;
}
.price-chart {
  height: 390px;
  width: 100%;
}
.chart-hover {
  font-family: "Consolas", monospace;
  font-size: 10px;
  color: var(--muted);
  min-height: 25px;
}
.chart-attribution {
  text-align: right;
  font-size: 9px;
  margin-top: 7px;
}
.chart-attribution a {
  color: var(--muted);
  text-decoration: none;
}
.chart-note {
  margin-bottom: 0;
}
.analysis-tabs {
  margin: 7px 0 22px;
}
.analysis-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.analysis-panel-grid .investment-panel {
  margin-bottom: 0;
}
.analysis-panel-grid > div > .investment-panel + .investment-panel {
  margin-top: 20px;
}
.indicator-definition {
  max-width: 230px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}
.data-notes {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  padding-left: 15px;
}
.analyst-distribution {
  display: grid;
  gap: 19px;
  margin: 30px 0;
}
.analyst-distribution > div {
  display: grid;
  grid-template-columns: 65px 1fr 25px;
  gap: 15px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.analyst-distribution > div > div {
  height: 6px;
  border-radius: 5px;
  background: #232839;
}
.analyst-distribution i {
  height: 6px;
  border-radius: 5px;
  display: block;
}
.source-link {
  color: var(--cyan);
  text-decoration: none;
  font-size: 11px;
  display: inline-block;
  margin-top: 18px;
}
.news-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.news-feed article {
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 9px;
  background: #131725;
  min-width: 0;
}
.news-meta {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
}
.news-meta > span {
  color: var(--violet);
}
.news-feed h3 {
  font-size: 14px;
  line-height: 1.7;
  margin: 14px 0 10px;
}
.news-feed a {
  color: var(--white);
  text-decoration: none;
}
.news-feed a:hover {
  color: var(--cyan);
}
.news-feed p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
  margin: 0;
}
.valuation-form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}
.valuation-form select,
.valuation-form input,
.valuation-form textarea {
  width: 100%;
  font-size: 12px;
}
.valuation-form button {
  justify-self: start;
}
.scenario-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}
@media (max-width: 1200px) {
  .portfolio-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .portfolio-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
  }
  .allocation-chart {
    width: 150px;
  }
}
@media (max-width: 850px) {
  .investment-page {
    padding: 22px;
  }
  .portfolio-overview,
  .stock-overview {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .analysis-panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .level-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .level-strip .investment-stat:nth-last-child(-n + 2) {
    grid-column: span 1;
  }
}
@media (max-width: 600px) {
  .investment-page {
    padding: 18px 14px;
  }
  .investment-page .page-heading {
    gap: 15px;
    align-items: flex-start;
  }
  .investment-page .page-heading h1 {
    font-size: 27px;
  }
  .investment-page .heading-actions {
    flex-direction: column;
    gap: 7px;
  }
  .investment-page .heading-actions button {
    font-size: 10px;
    padding: 8px 9px;
    white-space: nowrap;
  }
  .investment-page .page-heading p {
    font-size: 11px;
    max-width: 170px;
    line-height: 1.7;
  }
  .investment-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .investment-toolbar .segmented {
    justify-content: stretch;
  }
  .investment-toolbar button {
    flex: 1;
    font-size: 11px;
    padding: 8px;
  }
  .portfolio-capital {
    padding: 22px;
  }
  .capital-value {
    font-size: 32px;
  }
  .investment-stat {
    padding: 15px;
  }
  .investment-stat strong {
    font-size: 17px;
  }
  .portfolio-aside {
    grid-template-columns: minmax(0, 1fr);
  }
  .investment-panel {
    padding: 16px;
  }
  .panel-heading h2 {
    font-size: 14px;
  }
  .investment-table {
    min-width: 590px;
  }
  .ledger-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 13px;
  }
  .ledger-intro {
    flex-direction: column;
  }
  .table-toolbar .search-field {
    max-width: 180px;
  }
  .analysis-search {
    padding: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .analysis-search input {
    font-size: 12px;
  }
  .analysis-search > button {
    font-size: 10px;
    padding: 10px 9px;
  }
  .analysis-config {
    width: 100%;
    padding: 5px;
  }
  .analysis-config > div {
    left: 0;
    width: min(280px, calc(100vw - 100px));
  }
  .stock-quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stock-quick-stats .investment-stat:last-child {
    grid-column: span 2;
  }
  .level-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .level-strip .investment-stat:first-child {
    grid-column: span 2;
  }
  .panel-heading .segmented button {
    padding: 7px 10px;
    font-size: 10px;
  }
  .chart-controls {
    gap: 10px;
  }
  .chart-controls label {
    flex: 1 1 40%;
    flex-direction: column;
    align-items: flex-start;
  }
  .chart-controls select {
    width: 100%;
  }
  .chart-toggles {
    gap: 10px;
  }
  .chart-hover {
    font-size: 9px;
  }
  .observation-grid {
    gap: 0 12px;
  }
  .news-feed {
    grid-template-columns: minmax(0, 1fr);
  }
  .analysis-tabs {
    gap: 16px;
  }
  .analysis-tabs button {
    font-size: 11px;
  }
  .investment-tabs {
    gap: 18px;
  }
  .table-pagination {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-pulse {
    animation: none;
  }
}

.chart-controls label {
  white-space: nowrap;
}

.login-divider {
  color: var(--muted);
  font-size: 11px;
  margin: 24px 0;
  text-align: center;
  border-top: 1px solid var(--line);
}
.login-divider span {
  display: inline-block;
  background: var(--panel);
  padding: 0 12px;
  transform: translateY(-7px);
}
.memory-workspace {
  padding: 32px;
  overflow-y: auto;
  height: calc(100dvh - 80px);
}
.memory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.memory-heading p,
.memory-card small {
  color: var(--muted, #8897ae);
}
.memory-search {
  display: grid;
  gap: 8px;
  margin: 24px 0;
}
.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.memory-card,
.memory-editor,
.memory-proposal {
  padding: 20px;
  border: 1px solid #294353;
  border-radius: 14px;
  background: #111923;
  overflow-wrap: anywhere;
}
.memory-card p {
  white-space: pre-wrap;
}
.memory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.memory-editor {
  width: min(560px, calc(100vw - 32px));
  max-height: 90dvh;
  overflow-y: auto;
}
.memory-editor label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}
.memory-workspace input,
.memory-workspace textarea,
.memory-workspace select {
  color: #deedf3;
  background: #0b111a;
  border: 1px solid #294353;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
}
.memory-editor input[type="checkbox"] {
  width: auto;
  justify-self: start;
}
.memory-editor textarea {
  min-height: 120px;
}
.memory-proposal {
  margin-top: 16px;
}
.memory-usage small {
  color: #8897ae;
}
@media (max-width: 640px) {
  .memory-workspace {
    padding: 16px;
  }
  .memory-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .memory-grid {
    grid-template-columns: 1fr;
  }
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #050913cc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.context-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--muted, #93a8b9);
}
.context-controls button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 5px 8px;
}

.capability-tabs {
  margin: 20px 32px 0;
}
.capability-tabs button {
  min-height: 44px;
  min-width: 100px;
}
#skills-workspace {
  padding: 28px 32px;
}
.skill-fields label {
  display: block;
  margin: 14px 0;
}
.skill-fields input:not([type="checkbox"]),
.skill-fields textarea,
.skill-fields select {
  width: 100%;
  margin-top: 8px;
}
.skill-workflow {
  min-height: 320px;
  font-family: monospace;
}
.skill-link {
  display: flex !important;
  gap: 12px;
  align-items: center;
}
.skill-link small {
  display: block;
  color: var(--muted);
}
.skill-result {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.skill-empty {
  text-align: center;
  padding: 60px 16px;
}
#skill-detail .detail-tabs {
  overflow-x: auto;
}
#skill-detail .detail-tabs button {
  flex-shrink: 0;
  min-height: 44px;
}
@media (max-width: 700px) {
  #skills-workspace {
    padding: 20px 16px;
  }
  .capability-tabs {
    margin: 16px 16px 0;
  }
  #skill-detail .drawer-footer {
    flex-wrap: wrap;
  }
}
/* Personal context hub: one bounded scrolling surface inside the application shell. */
.personalization-workspace {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(ellipse at top right, #35204c24, transparent 65%);
}
.personalization-heading {
  padding: 30px 36px 20px;
}
.personalization-heading h1 {
  font-size: clamp(26px, 3vw, 38px);
  margin: 14px 0 10px;
  letter-spacing: -0.04em;
}
.personalization-heading p {
  color: var(--muted);
  margin: 0;
}
.personalization-tabs {
  display: flex;
  gap: 8px;
  margin: 0 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.personalization-tabs button {
  flex: 1;
  max-width: 280px;
  display: grid;
  gap: 7px;
  padding: 15px 20px;
  text-align: left;
  border-radius: 12px;
  background: #11141e;
  border: 1px solid var(--line);
}
.personalization-tabs button[aria-selected="true"] {
  background: #58f3d510;
  border-color: #59dacd;
  box-shadow: inset 3px 0 #64eed6;
}
.personalization-tabs b {
  font-size: 16px;
}
.personalization-tabs span {
  color: var(--muted);
  font-size: 12px;
}
.personalization-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 36px 40px;
}
.personalization-content .memory-workspace,
.personalization-content #skills-workspace {
  padding: 0;
  height: auto;
  overflow: visible;
}
.personalization-content .page-heading {
  margin-bottom: 22px;
}
.personalization-content h2 {
  font-size: 20px;
  margin: 0 0 10px;
}
.personalization-content .page-heading p,
.memory-heading p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.memory-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 18px;
}
.memory-toolbar .search-field {
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.memory-toolbar .search-field input {
  border: 0;
  background: transparent;
}
.memory-toolbar select {
  width: auto;
  font-size: 13px;
}
.memory-results {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  margin: 18px 0;
  font-size: 12px;
}
.personalization-content .memory-grid {
  grid-template-columns: 1fr;
  max-width: 1000px;
  gap: 14px;
}
.personalization-content .memory-card {
  background: linear-gradient(130deg, #151a25, #10141d);
  border-color: #2d3646;
  padding: 22px 24px;
}
.memory-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  color: #a8b4c9;
  font-size: 11px;
}
.memory-card-labels > span {
  padding: 4px 8px;
  background: #ffffff06;
  border-radius: 5px;
}
.memory-card-labels .memory-state {
  margin-left: auto;
}
.memory-state.active {
  color: #73e4cd;
}
.memory-state.paused,
.memory-state.expired {
  color: #b3a1cf;
}
.memory-content {
  color: #e3ecf5;
  font-size: 16px;
  line-height: 1.8;
  margin: 15px 0 20px;
}
.memory-actions button,
.memory-more summary {
  padding: 8px 13px;
  font-size: 12px;
}
.memory-actions {
  align-items: flex-start;
}
.memory-more {
  margin-left: auto;
  min-width: 65px;
}
.memory-more summary {
  cursor: pointer;
  color: var(--muted);
}
.memory-more > div {
  display: grid;
  gap: 10px;
  padding: 10px;
  max-width: 300px;
}
.memory-empty {
  border: 1px dashed #364559;
  border-radius: 16px;
  text-align: center;
  padding: 50px 24px;
  color: var(--muted);
}
.memory-empty h3 {
  color: var(--text);
}
.memory-editor {
  color: #e3ecf5;
  background: #111722;
  border: 1px solid #38666a;
  box-shadow: 0 30px 100px #000a;
}
.memory-editor::backdrop {
  background: #050913bd;
  backdrop-filter: blur(6px);
}
.memory-editor p,
.memory-editor small {
  color: #a0adbe;
  line-height: 1.7;
}
.memory-editor fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.memory-editor input,
.memory-editor select,
.memory-editor textarea {
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  border: 1px solid #364457;
  background: #0b1019;
  color: #e3ecf5;
  font: inherit;
  color-scheme: dark;
}
.memory-editor .memory-enabled {
  display: flex;
  align-items: center;
}
.memory-advanced {
  margin-top: 20px;
  border-top: 1px solid #2d3646;
  padding-top: 16px;
}
.memory-advanced summary {
  cursor: pointer;
  color: #b5c5d9;
  font-size: 13px;
}
.memory-editor blockquote {
  margin: 20px 0;
  padding: 16px;
  border-left: 2px solid #60d4c6;
  background: #60d4c60b;
  white-space: pre-wrap;
}
@media (max-width: 640px) {
  .personalization-heading {
    padding: 22px 18px 18px;
  }
  .personalization-heading p {
    font-size: 12px;
    line-height: 1.8;
  }
  .personalization-tabs {
    margin: 0 18px;
    gap: 8px;
  }
  .personalization-tabs button {
    padding: 12px;
  }
  .personalization-tabs span {
    font-size: 10px;
  }
  .personalization-content {
    padding: 22px 16px 40px;
  }
  .memory-heading {
    gap: 18px;
  }
  .memory-heading .primary {
    width: 100%;
    justify-content: center;
  }
  .memory-toolbar .search-field {
    flex-basis: 100%;
  }
  .memory-toolbar select {
    flex: 1;
    min-width: 0;
  }
  .personalization-content .memory-card {
    padding: 18px 16px;
  }
  .memory-card-labels .memory-state {
    margin-left: 0;
  }
  .memory-content {
    font-size: 14px;
  }
  .memory-editor {
    padding: 20px;
    max-height: calc(100dvh - 24px);
  }
  .personalization-content #skills-workspace .page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }
  .personalization-content #skills-workspace .heading-actions {
    justify-content: space-between;
  }
}
.turn-usage p {
  margin: 4px 0;
}
.usage-total {
  color: #8897ae;
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .usage-total {
    white-space: normal;
  }
}
