:root {
  color-scheme: light dark;
}

* {
  box-sizing: border-box;

}

@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #cccccc;
    --bar-color: rgb(201, 205, 209);
    --bar-bg: #e5e7eb;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #000;
    --text-color: #ffffff;
    --border-color: #444444;
    --bar-color: rgb(255, 119, 92);
    --bar-bg: rgb(23, 23, 23);
  }
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 1.25rem;
  margin: 0 auto;
  max-width: 960px;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: initial;
  text-decoration: overline;
}

nav a:hover {
  background: rgba(0, 0, 0, 0.1);
}

.header {
  padding-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-start {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.letta-logo {
  width: 3rem;
  height: 3rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border: 0.063rem solid var(--border-color);
}

th {
  font-weight: 600;
}

.model-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.model-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
  .model-icon,
  .letta-logo {
    filter: invert(1) brightness(1);
  }
}

body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-bar {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-color);
  outline: none;
  transition: border-color 0.2s ease;
}

.no-js .search-bar {
  display: none;
}

.search-bar:focus {
  border-color: rgb(6, 6, 172);
}

.search-bar::placeholder {
  color: var(--text-color);
  opacity: 0.5;
}

.chart-container {
  border: 1px solid var(--border-color);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  width: 100%;
  overflow: visible;
}

.chart-container--inner {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  height: 0;
}

.chart-row {
  display: grid;
  grid-template-columns: 20rem minmax(300px, 600px);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.chart-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  overflow: hidden;
}

.chart-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bar-bg);
  height: 2rem;
  position: relative;
  width: 100%;
}

.chart-bar {
  background: var(--bar-color);
  height: 100%;
  min-width: 0.125rem;
  transition: width 0.3s ease;
}

.chart-value {
  position: absolute;
  right: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cost-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  width: 60px;
  text-align: center;
}

.title {
    font-size: 0.75rem;
    font-weight: 700;
    margin:0;
}

.subtitle {
    font-size: 2.0rem;
    font-weight: 300;

    margin:0;
}

.caption  {
  padding: 0.5rem 0;
  line-height: 1.5;
  font-size: 1rem;
  display: flex;
  gap: 1.5rem;
  flex-direction: column;
}

.caption-inner {
  max-width: 700px;
}

.caption-inner:last-child {
  margin-bottom: 0;
}

.tabs-container {
  margin: 1.5rem 0 1rem 0;
  max-width: 100%;
  width: 100%;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
}

.tab-button {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  color: var(--text-color);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  font-weight: 500;
  position: relative;
  bottom: -2px;
}

.tab-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.tab-button.active {
  border-bottom-color: var(--text-color);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
}

.multi-metric-header {
  display: grid;
  grid-template-columns: 24rem 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  padding-top: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  overflow: visible;
  position: relative;
  z-index: 50;
}

.model-column-header {
  font-size: 0.875rem;
}

.metrics-columns-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  overflow: visible;
}

.metric-column-header {
  font-size: 0.875rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  position: relative;
}

/* Tooltip styles */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  z-index: 1000;
}

.info-icon {
  color: var(--text-color);
  opacity: 0.5;
  transition: opacity 0.2s ease;
  display: block;
}

.info-tooltip:hover .info-icon {
  opacity: 1;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: normal;
  white-space: normal;
  width: max-content;
  max-width: 280px;
  z-index: 99999;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Adjust tooltip position for right-aligned elements */
.metric-column-header:last-child .tooltip-text,
.metrics-columns-header > div:last-child .tooltip-text {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

/* Adjust arrow position for right-aligned tooltips */
.metric-column-header:last-child .tooltip-text::after,
.metrics-columns-header > div:last-child .tooltip-text::after {
  left: auto;
  right: 1rem;
  transform: translateX(0);
}

.info-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  .tooltip-text {
    background-color: rgba(255, 255, 255, 0.95);
    color: #000000;
  }

  .tooltip-text::after {
    border-top-color: rgba(255, 255, 255, 0.95);
  }
}

.multi-metric-row {
  display: grid;
  grid-template-columns: 24rem 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

.model-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.model-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.metric-column {
  min-width: 0;
}

@media (max-width: 1200px) {
  .multi-metric-header,
  .multi-metric-row {
    grid-template-columns: 14rem 1fr;
  }

  .metrics-columns-header,
  .metrics-columns {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .multi-metric-header {
    display: none;
  }

  .multi-metric-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .metrics-columns {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .metric-column {
    display: grid;
    grid-template-columns: 6rem 1fr;
    gap: 0.5rem;
    align-items: center;
  }

  .metric-column::before {
    content: attr(data-metric);
    font-size: 0.75rem;
    opacity: 0.7;
  }
}

/* Single metric header styles */
.single-metric-header {
  display: grid;
  grid-template-columns: 20rem minmax(300px, 600px);
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  padding-top: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  align-items: center;
  overflow: visible;
  position: relative;
  z-index: 50;
}

.metric-column-header-single {
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

@media (max-width: 900px) {
  .single-metric-header {
    display: none;
  }

  .chart-row {
    grid-template-columns: 14rem 1fr;
  }
}

@media (max-width: 600px) {
  .single-metric-header {
    display: none;
  }

  .chart-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .chart-bar-wrapper {
    height: 1.5rem;
  }

  .tabs {
    flex-direction: column;
    gap: 0;
  }

  .tab-button {
    text-align: left;
    border-bottom: 1px solid var(--border-color);
  }

  .tab-button.active {
    background: rgba(6, 6, 172, 0.1);
    border-left: 3px solid rgb(6, 6, 172);
    border-bottom: 1px solid var(--border-color);
  }
}