:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: #101722;
  --panel-2: #151e2b;
  --panel-3: #1b2635;
  --line: #273447;
  --line-soft: #1b2635;
  --text: #edf3fb;
  --muted: #91a0b4;
  --green: #35d48b;
  --red: #ff6678;
  --cyan: #43c7e8;
  --amber: #f2b84b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(67, 199, 232, 0.16), transparent 34rem),
    linear-gradient(135deg, #080b10 0%, #0e131b 48%, #080b10 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line-soft);
  background: rgba(8, 11, 16, 0.9);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(67, 199, 232, 0.5);
  border-radius: 8px;
  background: #0f2230;
  color: var(--cyan);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.panel-kicker,
.eyebrow,
.quote-label,
.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #bcc8d8;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(67, 199, 232, 0.3);
  background: #111d2a;
  color: var(--text);
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #172331;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
}

.phone-icon {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 42px;
  border: 2px solid rgba(67, 199, 232, 0.72);
  border-radius: 8px;
  background: #0c1621;
  box-shadow: inset 0 0 0 3px rgba(67, 199, 232, 0.06);
}

.phone-icon::before {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(237, 243, 251, 0.55);
  content: "";
  transform: translateX(-50%);
}

.phone-icon::after {
  position: absolute;
  right: 4px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(53, 212, 139, 0.58);
  content: "";
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.sidebar-panel strong,
.sidebar-panel p {
  display: block;
  margin-top: 8px;
}

.sidebar-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.content {
  display: grid;
  gap: 22px;
  align-content: start;
  padding: 28px;
}

.topbar,
.quote-strip,
.workspace-grid,
.section-heading,
.filter-bar {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.topbar p:not(.eyebrow) {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.search-box {
  display: grid;
  gap: 8px;
  width: min(100%, 430px);
}

.search-box label {
  color: var(--muted);
  font-size: 0.8rem;
}

.search-box div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.search-box input,
.search-box button {
  min-width: 0;
  border: 0;
}

.search-box input {
  padding: 13px 14px;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.search-box button,
.ghost-button,
.time-tabs button {
  cursor: pointer;
  color: var(--text);
}

.search-box button {
  padding: 0 16px;
  background: var(--cyan);
  color: #031015;
  font-weight: 800;
}

.quote-strip,
.metric-card,
.chart-panel,
.insight-panel,
.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.92);
  box-shadow: var(--shadow);
}

.quote-strip {
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.quote-strip strong,
.quote-label {
  display: block;
}

.quote-strip p {
  margin: 8px 0 0;
  color: var(--muted);
}

.quote-price {
  min-width: 190px;
  text-align: right;
}

.quote-price span {
  display: block;
  font-size: 2rem;
  font-weight: 850;
}

.quote-price strong {
  color: var(--green);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 16px;
}

.metric-card strong {
  font-size: 1.55rem;
}

.metric-card small {
  color: var(--green);
}

.workspace-grid {
  align-items: stretch;
  gap: 18px;
}

.chart-panel {
  flex: 1 1 62%;
  min-width: 0;
  padding: 18px;
}

.insight-panel {
  flex: 1 1 38%;
  min-width: 300px;
  padding: 18px;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
}

.time-tabs {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 6px;
}

.time-tabs button,
.ghost-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.time-tabs button.is-selected {
  border-color: rgba(53, 212, 139, 0.6);
  color: var(--green);
}

.sparkline {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 290px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 12.5% 100%,
    #0b1119;
}

.sparkline span {
  flex: 1;
  min-width: 10px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, var(--green), #176f56);
  box-shadow: 0 0 24px rgba(53, 212, 139, 0.18);
}

.research-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.notebook-library,
.notebook-viewer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.92);
  box-shadow: var(--shadow);
}

.notebook-library {
  padding: 18px;
}

.notebook-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.notebook-list a {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.notebook-list a:hover,
.notebook-list a.is-active {
  border-color: rgba(67, 199, 232, 0.36);
  background: #111d2a;
}

.notebook-list a.is-active strong {
  color: var(--cyan);
}

.notebook-list strong,
.notebook-list span {
  display: block;
}

.notebook-list span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.notebook-viewer {
  padding: 18px;
}

.notebook-cells {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.notebook-cell {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b1119;
}

.notebook-markdown {
  padding: 16px;
  color: #d8e1ed;
  line-height: 1.6;
  white-space: pre-wrap;
}

.notebook-cell pre {
  overflow-x: auto;
  margin: 0;
  padding: 16px;
  color: #d8e1ed;
}

.notebook-output {
  border-top: 1px solid var(--line-soft);
  background: rgba(53, 212, 139, 0.06);
}

.notification-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.notification-tester,
.past-notifications {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.92);
  box-shadow: var(--shadow);
}

.notification-tester {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 18px;
}

.tester-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(53, 212, 139, 0.56);
  border-radius: 8px;
  background: rgba(53, 212, 139, 0.12);
  color: var(--green);
  cursor: pointer;
  font-weight: 850;
}

.phone-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 180px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(67, 199, 232, 0.1), rgba(11, 17, 25, 0.98) 54%),
    #0b1119;
}

.phone-preview strong,
.phone-preview p {
  display: block;
}

.phone-preview p {
  max-width: 420px;
  margin: 8px 0 0;
  color: #c6d2e1;
  line-height: 1.5;
}

.phone-icon-large {
  width: 44px;
  height: 66px;
  border-radius: 10px;
}

.past-notifications {
  padding: 18px;
}

.past-notification-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.past-notification-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.past-notification-list strong,
.past-notification-list p {
  display: block;
}

.past-notification-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.past-notification-list span,
.past-notification-list small {
  white-space: nowrap;
}

.past-notification-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.past-notification-list small {
  padding: 5px 8px;
  border: 1px solid rgba(67, 199, 232, 0.3);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
}

.signal-list {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.signal-list li {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: #d5deeb;
  line-height: 1.5;
}

.filter-bar {
  flex-wrap: wrap;
  gap: 10px;
}

.filter-bar span {
  padding: 9px 12px;
  border: 1px solid rgba(242, 184, 75, 0.38);
  border-radius: 8px;
  background: rgba(242, 184, 75, 0.08);
  color: #f7dca3;
  font-size: 0.86rem;
  font-weight: 700;
}

.table-panel {
  padding: 18px;
}

.ghost-button {
  padding: 0 14px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  color: #d8e1ed;
}

tbody tr:hover {
  background: rgba(67, 199, 232, 0.06);
}

td:first-child {
  color: var(--text);
  font-weight: 850;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-panel {
    display: none;
  }

  .topbar,
  .workspace-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .research-workspace,
  .notification-workspace {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insight-panel {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .content,
  .sidebar {
    padding: 18px;
  }

  .nav-list,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .quote-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .quote-price {
    min-width: 0;
    text-align: left;
  }

  .search-box div {
    grid-template-columns: 1fr;
  }

  .search-box button {
    min-height: 42px;
  }

  .phone-preview,
  .past-notification-list li {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .phone-preview {
    flex-direction: column;
  }

  .sparkline {
    height: 220px;
  }
}
