:root {
  color-scheme: light;
  --bg: oklch(98.5% 0.004 240);
  --panel: oklch(99.2% 0.003 240);
  --panel-2: oklch(94.8% 0.007 240);
  --line: oklch(89% 0.01 240);
  --text: oklch(24% 0.026 248);
  --muted: oklch(63% 0.015 248);
  --accent: oklch(63% 0.09 251);
  --accent-quiet: oklch(91.5% 0.035 251);
  --danger: oklch(55% 0.19 24);
  --ok: oklch(60% 0.16 155);
  --shadow: 0 18px 44px oklch(34% 0.025 248 / 0.14);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
textarea,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  overflow: hidden;
  padding: 22px;
  background: var(--panel-2);
  border-right: 1px solid var(--line);
}

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

.brand.compact {
  margin-bottom: 18px;
}

.mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: oklch(98% 0.006 235);
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 16px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

.brand p,
.chat-head p,
.empty span {
  color: var(--muted);
  font-size: 13px;
}

.status-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 650;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
}

.dot.connected {
  background: var(--ok);
}

.dot.error {
  background: var(--danger);
}

dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.secondary,
.icon-button,
.composer button,
.login-card button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: background 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}

.secondary {
  margin-top: auto;
  height: 38px;
}

.secondary:hover,
.icon-button:hover {
  background: oklch(96% 0.012 235);
}

.chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(100%, 360px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.chat-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 68px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 14px 6px;
  background: var(--bg);
}

.header-spacer {
  display: flex;
  align-items: center;
}

.chat-title {
  min-width: 0;
  text-align: center;
}

.chat-title h1 {
  color: var(--text);
  font-size: 18px;
  font-weight: 720;
  line-height: 1.05;
}

.chat-title p {
  margin-top: 4px;
  color: oklch(70% 0.012 248);
  font-size: 10px;
  font-weight: 450;
}

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

.crown-button,
.settings-button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.crown-button {
  color: oklch(78% 0.16 84);
  font-size: 20px;
}

.settings-button {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.status-meta {
  display: none;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 14px 12px;
}

.empty {
  display: grid;
  gap: 6px;
  align-self: center;
  margin-top: 16vh;
  text-align: center;
}

.message {
  position: relative;
  max-width: min(300px, 84%);
  padding: 8px 11px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 520;
  line-height: 1.28;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message a {
  color: oklch(54% 0.13 252);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.message.user a {
  color: oklch(38% 0.12 252);
}

.message a:hover {
  color: oklch(45% 0.15 252);
}

.message.user {
  align-self: flex-end;
  background: oklch(90.5% 0.036 250);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

.message.assistant {
  align-self: flex-start;
  background: oklch(94.2% 0.006 250);
  border-bottom-left-radius: 4px;
}

.message.user::after,
.message.assistant::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 14px;
}

.message.user::after {
  right: -7px;
  background: oklch(90.5% 0.036 250);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.message.assistant::after {
  left: -7px;
  background: oklch(94.2% 0.006 250);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.message.error {
  align-self: center;
  max-width: min(680px, 92%);
  background: oklch(96% 0.04 24);
  border-color: oklch(82% 0.08 24);
  color: var(--danger);
}

.message.assistant.pending:empty {
  width: 36px;
  min-height: 26px;
  padding: 9px 10px;
  background: oklch(99% 0.003 248);
  box-shadow: 0 3px 10px oklch(38% 0.025 248 / 0.06);
}

.message.assistant.pending:empty::after {
  background: oklch(99% 0.003 248);
}

.message.assistant.pending:empty::before {
  content: "";
  display: block;
  width: 24px;
  height: 7px;
  background:
    radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 0 50% / 5px 5px no-repeat,
    radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 50% 50% / 5px 5px no-repeat,
    radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 100% 50% / 5px 5px no-repeat;
  animation: pending-dots 1.25s ease-in-out infinite;
}

@keyframes pending-dots {
  0%,
  100% {
    background:
      radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 0 50% / 5px 5px no-repeat,
      radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 50% 50% / 5px 5px no-repeat,
      radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 100% 50% / 5px 5px no-repeat;
  }

  20% {
    background:
      radial-gradient(circle, oklch(50% 0.018 248 / 0.85) 58%, transparent 60%) 0 50% / 5px 5px no-repeat,
      radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 50% 50% / 5px 5px no-repeat,
      radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 100% 50% / 5px 5px no-repeat;
  }

  45% {
    background:
      radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 0 50% / 5px 5px no-repeat,
      radial-gradient(circle, oklch(50% 0.018 248 / 0.85) 58%, transparent 60%) 50% 50% / 5px 5px no-repeat,
      radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 100% 50% / 5px 5px no-repeat;
  }

  70% {
    background:
      radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 0 50% / 5px 5px no-repeat,
      radial-gradient(circle, oklch(68% 0.012 248 / 0.35) 58%, transparent 60%) 50% 50% / 5px 5px no-repeat,
      radial-gradient(circle, oklch(50% 0.018 248 / 0.85) 58%, transparent 60%) 100% 50% / 5px 5px no-repeat;
  }
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 6px;
  margin: 0 12px 10px;
  padding: 4px 6px 4px 12px;
  border: 1px solid oklch(88% 0.009 248);
  border-radius: 15px;
  background: var(--panel);
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out, background 160ms ease-out;
}

.pending-files {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 2px 0 1px;
}

.pending-files[hidden] {
  display: none !important;
}

.pending-file {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 5px;
  min-height: 23px;
  padding: 0 5px 0 8px;
  border: 1px solid oklch(88% 0.012 248);
  border-radius: 999px;
  background: oklch(96.5% 0.007 248);
  color: var(--text);
  font-size: 11px;
}

.pending-file span {
  overflow: hidden;
  max-width: 190px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-file small {
  color: var(--muted);
  font-size: 10px;
}

.pending-file button {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.pending-file.uploading {
  color: var(--muted);
}

.composer.is-waiting {
  border-color: oklch(82% 0.032 248);
  background: oklch(98% 0.004 248);
  box-shadow: 0 4px 14px oklch(40% 0.04 248 / 0.08);
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 3px 12px 6px;
  background: var(--bg);
}

.quick-entry {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: oklch(95% 0.006 248);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 520;
}

.composer-menu,
.quick-menu {
  position: relative;
}

.toolbar-icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: oklch(95% 0.006 248);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.toolbar-icon-button:hover,
.toolbar-icon-button[aria-expanded="true"] {
  color: var(--text);
  background: oklch(96% 0.012 235);
}

.toolbar-file-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: oklch(93.5% 0.007 248);
  color: oklch(42% 0.025 248);
  cursor: pointer;
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  transition: background 160ms ease-out, color 160ms ease-out, transform 160ms ease-out, opacity 160ms ease-out;
}

.toolbar-file-button:hover,
.toolbar-file-button:focus-visible {
  background: oklch(90% 0.018 248);
  color: var(--text);
}

.toolbar-file-button:not(:disabled):active {
  transform: translateY(1px);
}

.toolbar-file-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.toolbar-file-button.is-uploading {
  color: transparent;
}

.toolbar-file-button.is-uploading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid oklch(78% 0.014 248);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: send-waiting 820ms linear infinite;
}

.composer-menu-popover {
  position: absolute;
  left: 0;
  bottom: 34px;
  min-width: 92px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 5;
}

.composer-menu-popover[hidden] {
  display: none !important;
}

.toolbar-menu-item {
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}

.toolbar-menu-item:hover {
  background: var(--accent-quiet);
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 32px;
  max-height: 120px;
  resize: none;
  padding: 7px 0;
}

.composer textarea {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 12px;
}

.composer textarea::placeholder {
  color: oklch(76% 0.013 248);
}

input {
  height: 42px;
  padding: 0 12px;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(62% 0.15 248 / 0.16);
}

.composer button,
.login-card button {
  background: var(--accent);
  border-color: var(--accent);
  color: oklch(98% 0.006 235);
  font-weight: 700;
}

.composer button {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: oklch(90% 0.006 248);
  color: oklch(78% 0.011 248);
  font-size: 17px;
  line-height: 1;
  transition: background 160ms ease-out, color 160ms ease-out, transform 160ms ease-out, opacity 160ms ease-out;
}

.composer button.send-button:not(:disabled) {
  background: var(--accent);
  color: oklch(99% 0.004 250);
}

.composer button:not(:disabled):hover {
  transform: translateY(-1px);
}

.composer button:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.composer button.send-button.is-sending {
  background: oklch(94% 0.014 248);
  color: transparent;
  cursor: progress;
  opacity: 1;
}

.composer button.send-button.is-sending::before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid oklch(76% 0.018 248);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: send-waiting 820ms linear infinite;
}

@keyframes send-waiting {
  to {
    transform: rotate(360deg);
  }
}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
}

.settings-panel[hidden] {
  display: none !important;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(28% 0.03 248 / 0.22);
}

.settings-sheet {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 360px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.token-sheet {
  grid-template-rows: auto minmax(0, 1fr);
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px 8px;
}

.settings-head h2 {
  font-size: 17px;
  font-weight: 720;
}

.settings-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.settings-close {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: oklch(94.8% 0.007 248);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  grid-row: 3;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 94%, white);
}

.settings-tabs button {
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 620;
}

.settings-tabs button.active {
  background: var(--accent);
  color: oklch(99% 0.004 250);
}

.settings-content {
  grid-row: 2;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 18px;
}

.settings-section,
.settings-list {
  display: grid;
  gap: 8px;
}

.settings-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.settings-section-title h3,
.settings-content h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
}

.settings-section-title button,
.settings-item-actions button,
.settings-market button,
.settings-wide-button {
  min-height: 26px;
  border: 0;
  border-radius: 7px;
  background: oklch(94.8% 0.007 248);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 620;
}

.settings-search {
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.settings-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.settings-item.compact {
  align-items: center;
  padding: 8px 10px;
}

.settings-item strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.settings-item p,
.settings-note,
.settings-empty,
.settings-loading {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.settings-item code {
  display: block;
  margin-top: 5px;
  color: oklch(42% 0.035 248);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.settings-item-actions {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 6px;
}

.settings-item-actions button {
  padding: 0 9px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.metric {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-top: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: oklch(94.8% 0.007 248);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.status-pill.ok {
  background: oklch(94% 0.035 155);
  color: oklch(43% 0.12 155);
}

.status-pill.warn {
  background: oklch(95% 0.035 85);
  color: oklch(47% 0.1 80);
}

.status-pill.bad,
.settings-note.error {
  background: oklch(96% 0.04 24);
  color: var(--danger);
}

.settings-market {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.settings-market p {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 11px;
}

.settings-wide-button {
  width: 100%;
  margin-top: 4px;
}

.channel-bind-card {
  background: oklch(96% 0.019 247);
}

.channel-bind-result {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid oklch(88% 0.025 250);
  border-radius: 12px;
  background: var(--panel);
}

.channel-bind-result img {
  width: 180px;
  height: 180px;
  border: 8px solid var(--panel);
  border-radius: 12px;
  box-shadow: 0 8px 20px oklch(35% 0.03 248 / 0.12);
}

.channel-bind-result p,
.channel-bind-result a {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

.channel-bind-result .channel-bind-success {
  color: oklch(42% 0.14 156);
  font-weight: 700;
}

.channel-bind-result a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.channel-bind-result pre {
  width: 100%;
  max-height: 160px;
  overflow: auto;
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: oklch(97% 0.004 248);
  color: oklch(42% 0.025 248);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  white-space: pre-wrap;
}

.skill-dashboard {
  display: grid;
  gap: 14px;
}

.skill-hero {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 30px;
  gap: 12px;
  align-items: center;
  padding: 4px 0 2px;
}

.skill-badge {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, oklch(62% 0.23 292), oklch(56% 0.23 274));
  color: oklch(99% 0.004 250);
  font-size: 26px;
  font-weight: 780;
  box-shadow: 0 8px 18px oklch(47% 0.2 285 / 0.24);
}

.skill-hero h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 760;
  line-height: 1.1;
}

.skill-hero p {
  margin-top: 6px;
  color: oklch(66% 0.014 248);
  font-size: 12px;
}

.skill-refresh {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: oklch(60% 0.014 248);
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.skill-search {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 520;
}

.skill-search::placeholder {
  color: oklch(67% 0.014 248);
}

.skill-install-button {
  height: 44px;
  border: 0;
  border-radius: 15px;
  background: oklch(77% 0.102 252);
  color: oklch(99% 0.004 250);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
}

.skill-info {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 13px;
  border: 1px solid oklch(88% 0.025 250);
  border-radius: 13px;
  background: oklch(96% 0.019 247);
  color: oklch(47% 0.13 252);
}

.skill-info span {
  font-size: 18px;
  line-height: 1.2;
}

.skill-info p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.skill-list-title {
  color: oklch(61% 0.014 248);
  font-size: 12px;
  font-weight: 720;
}

.skill-installed-box {
  display: grid;
  gap: 8px;
  min-height: 330px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.skill-empty {
  align-self: start;
  justify-self: center;
  padding-top: 34px;
  color: oklch(66% 0.014 248);
  font-size: 13px;
}

.skill-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid oklch(91% 0.008 248);
  border-radius: 10px;
  background: oklch(99% 0.002 248);
}

.skill-card strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.skill-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.skill-card button {
  align-self: flex-start;
  min-height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: oklch(94.8% 0.007 248);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 620;
}

.usage-dashboard {
  display: grid;
  gap: 14px;
}

.usage-hero h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 760;
  line-height: 1.1;
}

.usage-hero p {
  margin-top: 7px;
  color: oklch(66% 0.014 248);
  font-size: 12px;
  line-height: 1.3;
}

.usage-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.usage-segments {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: oklch(97% 0.005 248);
}

.usage-segments button,
.usage-refresh {
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: oklch(49% 0.025 248);
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
}

.usage-segments button.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 4px 12px oklch(35% 0.03 248 / 0.1);
}

.usage-refresh {
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  white-space: nowrap;
}

.usage-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.usage-stat-card {
  min-height: 86px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.usage-stat-card span,
.usage-stat-card small {
  display: block;
  color: oklch(66% 0.014 248);
  font-size: 11px;
  line-height: 1.3;
}

.usage-stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 23px;
  font-weight: 780;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.usage-stat-card small {
  margin-top: 9px;
}

.usage-stat-card.blue {
  background: oklch(96% 0.019 247);
}

.usage-stat-card.blue strong {
  color: oklch(57% 0.17 252);
}

.usage-stat-card.purple {
  background: oklch(96% 0.018 292);
}

.usage-stat-card.purple strong {
  color: oklch(55% 0.2 292);
}

.usage-stat-card.green {
  background: oklch(96% 0.024 158);
}

.usage-stat-card.green strong {
  color: oklch(52% 0.15 158);
}

.usage-stat-card.orange {
  background: oklch(97% 0.025 58);
}

.usage-stat-card.orange strong {
  color: oklch(60% 0.18 43);
}

.usage-stat-card.quota {
  grid-column: 1 / 2;
  background: oklch(98% 0.003 248);
}

.usage-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.usage-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
}

.usage-panel h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 760;
}

.usage-panel header span {
  color: var(--muted);
  font-size: 11px;
}

.usage-table {
  display: grid;
  min-width: 520px;
  overflow-x: auto;
}

.usage-table-head,
.usage-table-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.6fr) 0.55fr 0.75fr 0.75fr 0.75fr 0.75fr;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
}

.usage-table-head {
  color: oklch(66% 0.014 248);
  background: oklch(98% 0.003 248);
  font-size: 10px;
  font-weight: 760;
}

.usage-table-row {
  border-top: 1px solid var(--line);
  color: oklch(38% 0.025 248);
  font-size: 11px;
}

.usage-table-row strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.usage-record {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.usage-record:last-child {
  border-bottom: 0;
}

.usage-record strong {
  display: block;
  font-size: 12px;
}

.usage-record p,
.usage-record span {
  color: var(--muted);
  font-size: 11px;
}

.usage-question-list {
  display: grid;
}

.usage-question-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.usage-question-record:last-child {
  border-bottom: 0;
}

.usage-question-main {
  min-width: 0;
}

.usage-question-main strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.usage-question-main p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.usage-question-metrics {
  display: grid;
  min-width: 92px;
  justify-items: end;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.usage-question-metrics b {
  color: var(--accent);
  font-size: 12px;
}

.login-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: oklch(26% 0.03 235 / 0.36);
}

.login-overlay[hidden] {
  display: none !important;
}

.login-card {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card input,
.login-card button {
  margin-top: 10px;
}

.login-card button {
  width: 100%;
  height: 42px;
}

.error-text {
  min-height: 18px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
}

@media (max-width: 800px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }

  .sidebar {
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-panel {
    display: none;
  }

  .secondary {
    display: none;
  }

  .message {
    max-width: 92%;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 76px;
    padding: 12px;
  }

  .composer-toolbar {
    padding: 8px 12px 0;
  }
}
