/* Pulse — natural-language dashboards for Bittensor
   Identity: deep-indigo void, aurora field, glass bento cards with an
   ion gradient hairline (violet -> cyan), Space Grotesk display,
   JetBrains Mono numerals. Charts: cyan/violet with validated series. */

:root {
  color-scheme: dark;
  --void: #0b0e17;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #f2f4fb;
  --ink-2: #a8b0c6;
  --dim: #5f6880;
  --ion-a: #8b5cf6;
  --ion-b: #22d3ee;
  --ion-grad: linear-gradient(100deg, var(--ion-a), var(--ion-b));
  --up: #34d399;
  --down: #fb7185;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  --display: "Space Grotesk", ui-sans-serif, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.55;
  overflow-x: hidden;
}

/* aurora field — fixed, quiet, expensive-looking */
.aurora {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 34% at 12% 6%, rgba(139, 92, 246, 0.14), transparent 68%),
    radial-gradient(38% 30% at 92% 12%, rgba(34, 211, 238, 0.1), transparent 66%),
    radial-gradient(50% 40% at 55% 108%, rgba(139, 92, 246, 0.08), transparent 70%),
    radial-gradient(24% 22% at 78% 68%, rgba(244, 114, 182, 0.05), transparent 70%);
  filter: saturate(120%);
}

button, textarea, input { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--ion-b);
  outline-offset: 2px;
  border-radius: 4px;
}

.material-icons { font-size: 17px; line-height: 1; vertical-align: -3px; }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--dim); }

/* ---------------- header: floating glass bar ---------------- */

.header {
  position: sticky;
  top: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1480px;
  margin: 12px auto 0;
  padding: 10px 14px 10px 20px;
  width: calc(100% - 28px);
  background: rgba(15, 18, 30, 0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
}

.header-left, .header-right { display: flex; align-items: center; gap: 16px; }

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ion-grad);
  color: #0b0e17;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  transform: translateY(4px);
}

.main-nav { display: flex; gap: 2px; }

.nav-link {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 8px 13px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover { color: var(--ink); background: var(--glass-2); }
.nav-link.is-active { color: var(--ink); font-weight: 600; background: var(--glass); }

.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
}

.pill-tau {
  background: var(--ion-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.pill-change.up { color: var(--up); }
.pill-change.down { color: var(--down); }

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ion-grad);
  color: #0a0c14;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
  box-shadow: 0 6px 22px -8px rgba(139, 92, 246, 0.55);
}

.cta:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -8px rgba(34, 211, 238, 0.5); }
.cta:active { transform: translateY(0); }
.cta .material-icons { font-size: 17px; }

/* ---------------- layout ---------------- */

.main {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 34px 20px 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 4px 2px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: pulse 2.4s infinite;
}

.live-dot.err { background: var(--down); animation: none; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  position: relative;
  width: fit-content;
  margin: 10px 0 8px;
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

/* signature: the title carries a live ion underline */
.hero h1::after {
  content: "";
  position: absolute;
  left: 2px;
  right: -10px;
  bottom: -9px;
  height: 3px;
  border-radius: 999px;
  background: var(--ion-grad);
  background-size: 200% 100%;
  animation: ion-flow 6s linear infinite;
  opacity: 0.85;
}

@keyframes ion-flow {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.hero-sub { margin: 16px 0 0; color: var(--ink-2); font-size: 14px; max-width: 700px; }

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hero-pills { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 25px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ion-grad);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.ghost-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--glass); }
.ghost-btn.is-on { color: var(--ion-b); border-color: rgba(34, 211, 238, 0.4); background: rgba(34, 211, 238, 0.07); }
.ghost-btn .material-icons { font-size: 15px; }

.edit-fields {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  width: min(620px, 100%);
}

.edit-fields[hidden] { display: none; }

.edit-fields label {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.edit-fields span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.edit-fields input, .widget-title-input {
  height: 34px;
  padding: 0 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  outline: none;
  font-size: 13px;
  font-weight: 500;
}

.edit-fields input:focus, .widget-title-input:focus { border-color: var(--ion-b); }

/* ---------------- bento grid & glass cards ---------------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.widget {
  position: relative;
  grid-column: span 12;
  min-width: 0;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02) 55%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px);
  overflow: hidden;
  animation: rise 0.5s var(--ease) backwards;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

/* ion hairline across every card top — the system's quiet signature */
.widget::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--ion-grad);
  opacity: 0.35;
}

.widget:hover {
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

.widget:nth-child(1) { animation-delay: 0.02s; }
.widget:nth-child(2) { animation-delay: 0.07s; }
.widget:nth-child(3) { animation-delay: 0.12s; }
.widget:nth-child(4) { animation-delay: 0.17s; }
.widget:nth-child(5) { animation-delay: 0.22s; }
.widget:nth-child(6) { animation-delay: 0.27s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .widget { animation: none; }
  .hero h1::after { animation: none; }
  .live-dot { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

.widget.half { grid-column: span 6; }

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 12px;
}

.widget-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.widget-head .head-meta { color: var(--dim); font-family: var(--mono); font-size: 11px; }

.widget-body { padding: 4px 18px 18px; }
.widget-body.flush { padding: 0; }

.widget.is-editing { outline: 1px dashed rgba(34, 211, 238, 0.4); outline-offset: 3px; }
.widget.is-dragging { opacity: 0.45; }
.widget.is-drop-target { border-color: var(--ion-b); }

.widget-controls { display: flex; align-items: center; gap: 6px; }

.widget-controls button, .drag-handle {
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
}

.widget-controls button:hover { border-color: var(--line-strong); color: var(--ink); }
.drag-handle { cursor: grab; }
.widget-title-input { width: min(240px, 30vw); }

.empty-state {
  grid-column: span 12;
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--ink-2);
  text-align: center;
  background: var(--glass);
}

.empty-state strong { display: block; margin-bottom: 6px; font-family: var(--display); font-size: 18px; color: var(--ink); }

/* ---------------- metrics ---------------- */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
}

.metric {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 15px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  transition: background 0.15s, border-color 0.15s;
}

.metric:hover { background: var(--glass-2); border-color: var(--line); }

.metric-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.metric-value {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.metric-note { margin-top: auto; color: var(--dim); font-size: 11.5px; }

/* ---------------- table ---------------- */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(18, 22, 36, 0.9);
  backdrop-filter: blur(8px);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: right;
  padding: 8px 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}

thead th:first-child, thead th.left { text-align: left; }

tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12.5px;
}

tbody td:first-child, tbody td.left { text-align: left; }
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.035); }
tbody tr:last-child td { border-bottom: 0; }

.rank { color: var(--dim); width: 34px; }

.uid {
  display: inline-block;
  min-width: 36px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--glass);
  color: var(--ink-2);
  font-size: 11px;
  text-align: center;
}

.sn-cell { display: flex; align-items: center; gap: 10px; font-family: var(--body); }

.sn-avatar {
  width: 27px;
  height: 27px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
  overflow: hidden;
}

.sn-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sn-name { display: flex; flex-direction: column; line-height: 1.25; }
.sn-name strong { font-size: 13px; font-weight: 600; }
.sn-name small { color: var(--dim); font-family: var(--mono); font-size: 10.5px; }

.cell-sub { display: block; color: var(--dim); font-size: 10.5px; }

.spark { display: block; }

/* ---------------- leaderboard ---------------- */

.leader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
}

.leader-col {
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 13px 15px;
}

.leader-head {
  margin-bottom: 11px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(105px, 165px) minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
  min-height: 30px;
  font-size: 12.5px;
}

.bar-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-weight: 500;
}

.bar-track { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }

.bar-fill { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--up); }
.bar-fill.loss { background: var(--down); }

.bar-row strong { text-align: right; font-family: var(--mono); font-weight: 700; font-size: 12px; }

/* ---------------- charts ---------------- */

.chart-box { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  padding: 8px 11px;
  background: rgba(18, 22, 36, 0.95);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
  display: none;
}

.chart-tip .tip-date { color: var(--dim); font-size: 10.5px; display: block; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 10px 18px 14px;
  font-size: 12px;
  color: var(--ink-2);
}

.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 999px; flex: none; }

/* ---------------- subnet cards ---------------- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.sn-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}

.sn-card-top { display: flex; align-items: center; gap: 10px; }
.sn-card-top .sn-avatar { width: 34px; height: 34px; font-size: 14px; border-radius: 11px; }

.sn-card-desc {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.sn-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 12px; margin: 0; }
.sn-card-stats div { display: flex; justify-content: space-between; gap: 8px; }
.sn-card-stats dt { color: var(--dim); }
.sn-card-stats dd { margin: 0; font-family: var(--mono); font-weight: 500; }

/* ---------------- buttons / modal ---------------- */

.btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.btn:hover { border-color: var(--line-strong); background: var(--glass-2); }

.icon-button {
  width: 31px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
  color: var(--ink-2);
  font-size: 18px;
}

.icon-button:hover { color: var(--ink); border-color: var(--line-strong); }

.eyebrow {
  margin: 0 0 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ion-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  width: min(880px, calc(100vw - 28px));
  max-height: calc(100vh - 44px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(16, 19, 32, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h2 { margin: 0; font-family: var(--display); font-size: 16px; font-weight: 700; }
.modal-actions { display: flex; gap: 8px; }

.modal-card pre {
  margin: 0;
  overflow: auto;
  padding: 18px 20px;
  color: #9be8d0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

/* ---------------- builder drawer ---------------- */

.chat-drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 110;
  width: min(420px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  background: rgba(15, 18, 30, 0.88);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  backdrop-filter: blur(22px) saturate(140%);
  transform: translateX(calc(100% + 20px));
  transition: transform 0.28s var(--ease);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.55);
}

.chat-drawer.open { transform: translateX(0); }

.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 13px;
  border-bottom: 1px solid var(--line-soft);
}

.chat-head h2 { margin: 0; font-family: var(--display); font-size: 16.5px; font-weight: 700; }

.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px 18px;
}

.message {
  width: fit-content;
  max-width: 94%;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  background: var(--glass);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

.message.user {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(120deg, rgba(139, 92, 246, 0.16), rgba(34, 211, 238, 0.12));
  border-color: rgba(139, 92, 246, 0.35);
  color: var(--ink);
}

.message.thinking { color: var(--dim); font-style: italic; }

.message.thinking::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: thinking-dots 1.2s steps(4, end) infinite;
}

@keyframes thinking-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 10px;
  padding: 13px 18px 8px;
  border-top: 1px solid var(--line-soft);
}

textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  padding: 11px 13px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  outline: none;
  font-size: 13px;
}

textarea::placeholder { color: var(--dim); }
textarea:focus { border-color: var(--ion-b); }

.composer button[type="submit"] {
  min-height: 40px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--ion-grad);
  color: #0a0c14;
  font-weight: 700;
}

.composer button[type="submit"]:hover { filter: brightness(1.08); }
.composer button[type="submit"]:disabled { opacity: 0.55; cursor: wait; filter: none; }

.chat-foot {
  padding: 4px 18px 14px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
}

/* FAB — the "listening" ring */
.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 18, 30, 0.9);
  color: var(--ink);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.16s var(--ease), opacity 0.16s;
}

.chat-fab::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 0deg, var(--ion-a), var(--ion-b), transparent 65%, var(--ion-a));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 3.5s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .chat-fab::before { animation: none; }
}

.chat-fab:hover { transform: translateY(-2px) scale(1.05); }
.chat-fab:active { transform: scale(0.96); }
.chat-fab .material-icons { font-size: 24px; }

.chat-fab.is-hidden { opacity: 0; pointer-events: none; transform: scale(0.6); }

/* ---------------- footer ---------------- */

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: space-between;
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 24px 36px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 12.5px;
}

.footer-dim { color: var(--dim); }

/* ---------------- responsive ---------------- */

@media (max-width: 1080px) {
  .widget.half { grid-column: span 12; }
  .main-nav { display: none; }
}

@media (max-width: 720px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-side { align-items: flex-start; }
  .hero-pills { justify-content: flex-start; }
  .price-pill { display: none; }
  .bar-row { grid-template-columns: 1fr; gap: 4px; min-height: 0; padding-bottom: 8px; }
  .composer { grid-template-columns: 1fr; }
  .header { top: 8px; width: calc(100% - 16px); padding: 8px 10px 8px 14px; }
  .chat-drawer { top: 8px; right: 8px; bottom: 8px; }
}
