:root {
  color-scheme: dark;
  --bg: #0d1015;
  --glass: rgba(35, 38, 45, 0.72);
  --glass-strong: rgba(43, 46, 53, 0.9);
  --sidebar: rgba(25, 27, 32, 0.72);
  --elevated: rgba(255, 255, 255, 0.055);
  --elevated-hover: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.105);
  --line-soft: rgba(255, 255, 255, 0.065);
  --text: #f5f5f7;
  --secondary: #c7c7cc;
  --muted: #8e8e93;
  --blue: #0a84ff;
  --blue-light: #64d2ff;
  --green: #30d158;
  --yellow: #ffd60a;
  --danger: #ff453a;
  --shadow: 0 36px 100px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.32);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { min-height: 20px; color: #ff6961; }

.wallpaper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(5, 8, 14, .94), rgba(26, 28, 38, .84)),
    radial-gradient(circle at 48% 45%, #283447, transparent 58%);
  pointer-events: none;
}
.wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
.aurora { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .42; }
.aurora-blue { width: 56vw; height: 54vw; left: -17vw; bottom: -26vw; background: #117adf; }
.aurora-violet { width: 45vw; height: 45vw; right: -10vw; top: -19vw; background: #8d5cff; opacity: .3; }
.aurora-silver { width: 38vw; height: 24vw; left: 38vw; top: 25vh; background: #a7c4de; opacity: .12; }

.liquid-glass {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .1);
  backdrop-filter: blur(44px) saturate(160%);
  -webkit-backdrop-filter: blur(44px) saturate(160%);
}
.eyebrow {
  margin: 0 0 8px;
  color: #8fc9ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

/* Login */
.login-shell { position: relative; z-index: 1; display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 44px; border-radius: 30px; text-align: center; }
.login-card h1 { margin: 8px 0 8px; font-size: 36px; letter-spacing: -.04em; }
.login-card > p.muted { max-width: 330px; margin: 0 auto; line-height: 1.5; }
.login-icon {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 24px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(255,255,255,.3), rgba(255,255,255,.06)), linear-gradient(160deg, #268cff, #6d5dfc);
  box-shadow: 0 17px 38px rgba(0, 95, 255, .28), inset 0 1px 1px rgba(255,255,255,.5);
}
.spark { position: absolute; display: block; background: white; border-radius: 999px; box-shadow: 0 0 16px rgba(255,255,255,.7); }
.spark-one { width: 5px; height: 38px; left: 36px; top: 20px; transform: rotate(34deg); }
.spark-two { width: 34px; height: 5px; left: 21px; top: 37px; transform: rotate(34deg); }
.spark-three { width: 12px; height: 12px; left: 32px; top: 33px; }
.login-card form { display: grid; gap: 11px; margin-top: 30px; text-align: left; }
.login-card label { padding-left: 3px; }

/* Shared controls */
label { color: var(--secondary); font-size: 12px; }
input, textarea, select {
  color: var(--text);
  background: rgba(4, 6, 10, .32);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 11px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(10,132,255,.75);
  background: rgba(4,6,10,.44);
  box-shadow: 0 0 0 3px rgba(10,132,255,.17);
}
input { padding: 12px 13px; }
.primary {
  padding: 10px 16px;
  color: white;
  font-weight: 650;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px;
  background: linear-gradient(180deg, #2394ff, #0878e7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 7px 18px rgba(0,98,220,.22);
  transition: filter .15s, transform .15s;
}
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: scale(.98); }
.wide { width: 100%; margin-top: 7px; }

/* Window and sidebar */
.app-window {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  width: calc(100vw - 28px);
  height: calc(100vh - 28px);
  margin: 14px;
  overflow: hidden;
  border-radius: 22px;
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 13px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  box-shadow: inset -1px 0 rgba(0,0,0,.18);
}
.brand-row { display: flex; align-items: center; gap: 11px; padding: 3px 6px 15px; }
.brand-glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 750;
  background: linear-gradient(145deg, rgba(255,255,255,.22), rgba(255,255,255,.04)), linear-gradient(145deg, #168dff, #6857ee);
  box-shadow: inset 0 1px rgba(255,255,255,.24), 0 7px 18px rgba(0,0,0,.18);
}
.brand-row strong, .brand-row span { display: block; }
.brand-row strong { font-size: 14px; }
.brand-row span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.search-field { position: relative; margin: 0 3px 13px; }
.search-field svg {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 2;
}
.search-field input { width: 100%; height: 35px; padding: 7px 9px 7px 33px; border-radius: 9px; font-size: 12px; background: rgba(255,255,255,.055); }
.search-field input::-webkit-search-cancel-button { filter: invert(1); opacity: .55; }
.main-navigation { display: grid; gap: 3px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  color: var(--secondary);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
}
.nav-button:hover { color: var(--text); background: var(--elevated); }
.nav-button.active {
  color: white;
  border-color: rgba(255,255,255,.07);
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.085));
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.12);
}
.nav-icon { position: relative; display: block; width: 23px; height: 23px; border-radius: 6px; background: linear-gradient(180deg, #5bb4ff, #0878dd); box-shadow: inset 0 1px rgba(255,255,255,.3); }
.chat-icon::before { content: ""; position: absolute; inset: 6px 5px 7px; border: 1.5px solid white; border-radius: 5px; }
.chat-icon::after { content: ""; position: absolute; left: 7px; bottom: 4px; width: 5px; height: 5px; border-left: 1.5px solid white; transform: rotate(-28deg); }
.activity-icon { background: linear-gradient(180deg, #b09cff, #7456e8); }
.activity-icon::before { content: ""; position: absolute; left: 5px; right: 5px; bottom: 5px; height: 10px; border-left: 2px solid white; border-bottom: 2px solid white; }
.activity-icon::after { content: ""; position: absolute; left: 7px; top: 7px; width: 9px; height: 7px; border-top: 2px solid white; border-right: 2px solid white; transform: skewY(-30deg); }
.key-icon { background: linear-gradient(180deg, #ffb340, #f17715); }
.key-icon::before { content: ""; position: absolute; width: 7px; height: 7px; left: 5px; top: 7px; border: 2px solid white; border-radius: 50%; }
.key-icon::after { content: ""; position: absolute; width: 8px; height: 2px; right: 4px; top: 11px; background: white; box-shadow: 3px 3px white; transform: rotate(-35deg); }
.node-icon { background: linear-gradient(180deg, #47d7a1, #138e6f); }
.node-icon::before { content: ""; position: absolute; inset: 5px; border: 1.7px solid white; border-radius: 4px; }
.node-icon::after { content: "···"; position: absolute; top: 1px; left: 5px; color: white; font-size: 13px; font-weight: 800; letter-spacing: 1px; }
.conversation-section { display: flex; flex: 1; min-height: 0; flex-direction: column; padding-top: 13px; transition: opacity .18s; }
.conversation-section.view-muted { opacity: .5; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.round-button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0 0 1px;
  color: var(--secondary);
  font-size: 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}
.round-button:hover { color: white; border-color: var(--line); background: var(--elevated); }
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; }
.conversation-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin: 2px 0;
  padding: 8px 7px;
  color: var(--secondary);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
}
.conversation-item:hover { color: white; background: var(--elevated); }
.conversation-item.active { color: white; border-color: rgba(10,132,255,.2); background: rgba(10,132,255,.2); }
.conversation-symbol { width: 7px; height: 7px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; }
.conversation-item.active .conversation-symbol { border-color: #8fc9ff; background: #62b5ff; box-shadow: 0 0 8px rgba(10,132,255,.6); }
.conversation-copy { min-width: 0; }
.conversation-copy strong, .conversation-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { font-size: 12px; font-weight: 550; }
.conversation-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.conversation-empty { margin: 18px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 5px 0; border-top: 1px solid var(--line-soft); }
.model-mini-status { display: flex; align-items: center; gap: 8px; min-width: 0; }
.model-mini-status .status-dot { width: 7px; height: 7px; background: var(--green); }
.model-mini-status strong, .model-mini-status span { display: block; }
.model-mini-status strong { font-size: 11px; }
.model-mini-status div span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.logout-button { padding: 6px 7px; color: var(--muted); font-size: 10px; border: 0; border-radius: 7px; background: transparent; }
.logout-button:hover { color: white; background: var(--elevated); }

/* Workspace */
.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: rgba(32,34,40,.42); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 99px; gap: 20px; padding: 20px 27px; border-bottom: 1px solid var(--line); background: rgba(30,32,38,.38); }
.topbar-copy { min-width: 0; }
.topbar h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 21px; font-weight: 650; letter-spacing: -.025em; }
.view-description { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.14);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 8px currentColor; }
.status-pill.online { color: #79e891; }
.status-pill.online .status-dot { background: var(--green); }
.status-pill.offline { color: #ff817a; }
.status-pill.offline .status-dot { background: var(--danger); }
.toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--secondary);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}
.toolbar-button:hover { color: white; background: var(--elevated-hover); }
.toolbar-button svg { width: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.toolbar-button.danger:hover { color: #ff817a; border-color: rgba(255,69,58,.28); background: rgba(255,69,58,.09); }
.toolbar-button:disabled { opacity: .45; }
.workspace-view { display: flex; flex: 1; min-height: 0; flex-direction: column; }

/* Empty and conversation */
.empty-state { display: grid; place-items: center; align-content: center; flex: 1; padding: 40px; text-align: center; }
.empty-state .eyebrow { margin-top: 28px; }
.empty-state h3 { margin: 0 0 7px; font-size: clamp(25px, 3vw, 34px); font-weight: 680; letter-spacing: -.045em; }
.empty-state > p:not(.eyebrow) { max-width: 530px; margin: 0 0 23px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.hero-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 29px;
  background: linear-gradient(145deg, rgba(255,255,255,.24), rgba(255,255,255,.025)), linear-gradient(145deg, #2499ff, #7866f7);
  box-shadow: inset 0 1px rgba(255,255,255,.36), 0 24px 55px rgba(15,102,245,.28);
  transform: rotate(-3deg);
}
.hero-orb::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(255,255,255,.16); border-radius: 23px; }
.hero-orb span { font-size: 39px; font-weight: 750; text-shadow: 0 4px 14px rgba(0,0,0,.26); transform: rotate(3deg); }
.chat-view { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.message-list { flex: 1; overflow-y: auto; padding: 27px clamp(20px, 5vw, 80px); scroll-behavior: smooth; }
.message { display: flex; gap: 13px; max-width: 880px; margin: 0 auto 26px; }
.message-avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  background: linear-gradient(145deg, #2697ff, #7763e9);
  box-shadow: inset 0 1px rgba(255,255,255,.25);
}
.message.user .message-avatar { color: #202127; background: linear-gradient(145deg, #e9e9ee, #a9abb2); }
.message-body { min-width: 0; padding-top: 1px; }
.message-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.message-meta strong { font-size: 12px; }
.message-meta span { color: var(--muted); font-size: 9px; }
.message-content { color: #e7e7ea; font-size: 14px; line-height: 1.72; overflow-wrap: anywhere; white-space: pre-wrap; }
.message.user .message-content { color: var(--secondary); }
.message.pending .message-content::after { content: "▋"; color: #74baff; animation: blink .8s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer {
  margin: 0 clamp(15px, 4vw, 65px) 20px;
  padding: 10px 11px 9px 15px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 17px;
  background: rgba(22,24,29,.68);
  box-shadow: 0 17px 55px rgba(0,0,0,.27), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(24px) saturate(140%);
}
.composer textarea { width: 100%; max-height: 180px; resize: none; padding: 7px 0 10px; border: 0; background: transparent; line-height: 1.5; }
.composer textarea:focus { box-shadow: none; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.settings-row { display: flex; align-items: center; gap: 14px; }
.settings-row label { display: flex; align-items: center; gap: 7px; }
.settings-row select { padding: 4px 7px; font-size: 11px; }
.settings-row label:has(select) { min-width: 0; }
.settings-row label:has(select) select { max-width: 150px; }
.toggle input { display: none; }
.toggle span { position: relative; width: 29px; height: 17px; border-radius: 999px; background: #56585f; box-shadow: inset 0 1px 2px rgba(0,0,0,.28); transition: .18s; }
.toggle span::after { content: ""; position: absolute; width: 13px; height: 13px; top: 2px; left: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: .18s; }
.toggle input:checked + span { background: var(--blue); }
.toggle input:checked + span::after { left: 14px; }
.send-button { display: grid; place-items: center; width: 34px; height: 34px; color: white; font-size: 19px; border: 0; border-radius: 10px; background: linear-gradient(180deg, #2997ff, #087cf0); box-shadow: inset 0 1px rgba(255,255,255,.3), 0 6px 15px rgba(0,91,215,.22); }
.send-button:disabled { opacity: .35; }

/* Usage and API Keys */
.management-view { gap: 14px; overflow-y: auto; padding: 22px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.summary-card, .content-card, .key-reveal {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  box-shadow: inset 0 1px rgba(255,255,255,.055), 0 10px 30px rgba(0,0,0,.11);
}
.summary-card { min-height: 119px; padding: 17px; }
.summary-card span, .summary-card strong, .summary-card small { display: block; }
.summary-card span { color: var(--secondary); font-size: 11px; }
.summary-card strong { margin: 15px 0 5px; font-size: 25px; letter-spacing: -.04em; }
.summary-card small { color: var(--muted); font-size: 9px; }
.content-card { overflow: hidden; }
.content-card-header { display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 76px; padding: 15px 17px; border-bottom: 1px solid var(--line-soft); }
.content-card-header h3 { margin: 0; font-size: 14px; }
.content-card-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.activity-list, .key-list { min-height: 170px; }
.activity-row, .key-row { display: flex; align-items: flex-start; gap: 13px; padding: 15px 17px; border-bottom: 1px solid var(--line-soft); }
.activity-row:last-child, .key-row:last-child { border-bottom: 0; }
.activity-row:hover, .key-row:hover { background: rgba(255,255,255,.025); }
.request-indicator { width: 8px; height: 8px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--danger); box-shadow: 0 0 9px rgba(255,69,58,.28); }
.request-indicator.success { background: var(--green); box-shadow: 0 0 9px rgba(48,209,88,.3); }
.activity-main, .key-main { min-width: 0; flex: 1; }
.activity-title, .key-title { display: flex; align-items: center; gap: 9px; }
.activity-title strong, .key-title strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.activity-title span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.activity-main p, .key-main p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.activity-main .response-preview { color: #b7b7bd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-metrics { min-width: 67px; text-align: right; }
.activity-metrics strong, .activity-metrics span { display: block; }
.activity-metrics strong { font-size: 12px; }
.activity-metrics span { margin-top: 5px; color: var(--muted); font-size: 9px; }
.loading-row, .empty-list { display: grid; place-items: center; align-content: center; min-height: 170px; padding: 26px; color: var(--muted); font-size: 11px; text-align: center; }
.empty-list strong, .empty-list span { display: block; }
.empty-list strong { margin-bottom: 6px; color: var(--secondary); font-size: 12px; }
.keys-header { align-items: flex-end; }
.key-create-form { display: flex; gap: 8px; }
.key-create-form input { width: min(210px, 25vw); height: 36px; }
.key-create-form select { min-width: 150px; height: 36px; padding: 7px 10px; font-size: 11px; }
.key-create-form .primary { height: 36px; padding: 7px 12px; font-size: 11px; white-space: nowrap; }
.key-reveal { display: grid; grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 15px 17px; border-color: rgba(10,132,255,.35); background: linear-gradient(145deg, rgba(10,132,255,.16), rgba(100,210,255,.055)); }
.key-reveal strong { font-size: 12px; }
.key-reveal p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.key-reveal code { overflow-x: auto; padding: 10px; color: #9ed1ff; font-size: 10px; border-radius: 8px; background: rgba(0,0,0,.26); }
.key-reveal .primary { padding: 8px 11px; font-size: 10px; }
.key-badge { position: relative; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 9px; background: linear-gradient(145deg, #ffb23f, #ec7219); box-shadow: inset 0 1px rgba(255,255,255,.3); }
.key-badge::before { content: ""; position: absolute; width: 8px; height: 8px; left: 7px; top: 8px; border: 2px solid white; border-radius: 50%; }
.key-badge::after { content: ""; position: absolute; width: 10px; height: 2px; right: 5px; top: 15px; background: white; box-shadow: 3px 3px white; transform: rotate(-38deg); }
.key-main code { display: block; margin-top: 6px; color: #c2c2c8; font-size: 10px; }
.state-label { padding: 2px 6px; color: var(--muted); font-size: 8px; border: 1px solid var(--line); border-radius: 999px; }
.state-label.active { color: #79e891; border-color: rgba(48,209,88,.22); background: rgba(48,209,88,.07); }
.key-row.revoked { opacity: .52; }
.danger-button { align-self: center; padding: 6px 9px; color: #ff817a; font-size: 10px; border: 1px solid rgba(255,69,58,.22); border-radius: 8px; background: rgba(255,69,58,.035); }
.danger-button:hover { background: rgba(255,69,58,.11); }

/* Nodes */
.node-list { min-height: 150px; }
.node-row { display: flex; align-items: flex-start; gap: 13px; padding: 15px 17px; border-bottom: 1px solid var(--line-soft); }
.node-row:last-child { border-bottom: 0; }
.node-row:hover { background: rgba(255,255,255,.025); }
.node-row.disabled { opacity: .58; }
.node-indicator { width: 10px; height: 10px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px rgba(255,69,58,.32); }
.node-indicator.online { background: var(--green); box-shadow: 0 0 10px rgba(48,209,88,.35); }
.node-indicator.disabled { background: var(--muted); box-shadow: none; }
.node-main { flex: 1; min-width: 0; }
.node-title { display: flex; align-items: center; gap: 9px; }
.node-title strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.node-main p, .node-main small { display: block; margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.node-main small { color: #aeb0b7; }
.node-create-form { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(130px, .9fr) minmax(180px, 1.5fr) minmax(210px, 1.6fr) auto; gap: 9px; padding: 16px 17px; }
.node-create-form input { min-width: 0; height: 37px; font-size: 11px; }
.node-create-form .primary { height: 37px; padding: 7px 12px; white-space: nowrap; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 27px; transform: translateX(-50%); padding: 9px 14px; color: white; font-size: 11px; font-weight: 600; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(52,54,61,.9); box-shadow: 0 12px 35px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.12); backdrop-filter: blur(20px); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: rgba(255,255,255,.17); background-clip: padding-box; }

@media (max-width: 820px) {
  body { overflow: auto; }
  .app-window { grid-template-columns: 1fr; width: 100%; min-height: 100vh; height: auto; margin: 0; border: 0; border-radius: 0; }
  .sidebar { min-height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-row { padding-top: 3px; }
  .main-navigation { grid-template-columns: repeat(3, 1fr); border-bottom: 0; }
  .nav-button { justify-content: center; }
  .conversation-section { flex: none; }
  .conversation-section.view-muted { display: none; }
  .conversation-list { display: flex; gap: 4px; max-height: 66px; overflow-x: auto; }
  .conversation-item { min-width: 190px; }
  .sidebar-footer { display: none; }
  .workspace { min-height: 72vh; }
  .topbar { min-height: 86px; padding: 16px; }
  .topbar h2 { font-size: 18px; }
  .view-description { max-width: 48vw; }
  .toolbar-button span { display: none; }
  .message-list { min-height: 50vh; padding: 22px 16px; }
  .composer { margin: 0 10px 10px; }
  .management-view { padding: 13px; }
  .content-card-header.keys-header { align-items: stretch; flex-direction: column; }
  .key-create-form input { width: 100%; }
  .key-create-form { flex-wrap: wrap; }
  .key-create-form select { flex: 1; }
  .node-create-form { grid-template-columns: 1fr 1fr; }
  .node-create-form input:nth-child(3), .node-create-form input:nth-child(4) { grid-column: 1 / -1; }
  .key-reveal { grid-template-columns: 1fr auto; }
  .key-reveal code { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 520px) {
  .brand-row { display: none; }
  .search-field { margin-top: 2px; }
  .nav-button { gap: 6px; padding: 7px 5px; font-size: 11px; }
  .nav-icon { width: 21px; height: 21px; }
  .status-pill { display: none; }
  .view-description { max-width: 67vw; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 87px; }
  .summary-card strong { margin: 9px 0 3px; }
  .activity-row { gap: 9px; padding: 13px; }
  .activity-title { align-items: flex-start; flex-direction: column; gap: 3px; }
  .activity-metrics { min-width: 50px; }
  .settings-row { gap: 8px; }
  .settings-row { flex-wrap: wrap; }
  .settings-row label:has(select) select { max-width: 105px; }
  .node-create-form { grid-template-columns: 1fr; }
  .node-create-form input:nth-child(3), .node-create-form input:nth-child(4) { grid-column: auto; }
  .message { gap: 9px; }
  .message-avatar { width: 28px; height: 28px; }
  .login-card { padding: 34px 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
