/* Developer Tools Index widget — Lemon.io design system (tokens from the Lemon.io Design System artifact) */
:root {
  --ink: #060e15;            /* color-brand-black / color-text-primary */
  --bg: #ffffff;             /* color-background-white */
  --muted: #6b6b6b;          /* color-grey-600: supporting text that still passes 4.5:1 */
  --border: rgba(6, 14, 21, 0.1); /* color-borders-primary */
  --up: #1a7a3c;             /* color-status-success */
  --down: #cc3300;           /* color-status-error */
  --row-hover: #f6f6f6;      /* color-grey-50 */
  --line: #060e15;
  --area-top: rgba(249, 248, 96, 0.6);   /* color-brand-yellow */
  --area-bottom: rgba(249, 248, 96, 0.04);
  --grid: rgba(6, 14, 21, 0.06);
  --font-sans: "Suisse Int'l", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}
/* Lemon is light-only; dark mirrors its dark sections (black ground, white text). */
[data-theme="dark"] {
  --ink: #ffffff;
  --bg: #060e15;
  --muted: #a3a3a3;
  --border: rgba(255, 255, 255, 0.12);
  --up: #4cc27a;
  --down: #ff7a50;
  --row-hover: #0f171e;
  --line: #f9f860;
  --area-top: rgba(249, 248, 96, 0.3);
  --area-bottom: rgba(249, 248, 96, 0.02);
  --grid: rgba(255, 255, 255, 0.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  font-family: var(--font-sans);
  font-weight: 450; /* one weight across the system */
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
b, strong, th, h1 { font-weight: inherit; }
h1 .by { color: var(--muted); }

/* Fills the iframe: the table takes whatever height is left (10 rows at the recommended 860px). */
.devx {
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 14px;
  overflow: hidden;
}

/* Header */
.hdr { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 24px; }
.hdr-title { display: flex; flex-direction: column; gap: 8px; }
h1 { font-size: 20px; line-height: 1.2; margin: 0; letter-spacing: -0.3px; }
.badge {
  align-self: flex-start;
  font-size: 12px; line-height: 1; padding: 6px 8px;
  background: linear-gradient(180deg, #f6f6f6 -82.5%, #f9f860 100%); /* gradient-lemon */
  color: #060e15; white-space: nowrap;
}
.hdr-value { display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.value { font-size: 40px; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.chg { font-size: 16px; font-variant-numeric: tabular-nums; }
.asof { font-size: 12px; color: var(--muted); width: 100%; text-align: right; }
.up { color: var(--up); }
.down { color: var(--down); }

/* Controls: Lemon Tabs (text items, 1.5px ink rule under the active one) */
.controls { display: flex; flex-wrap: wrap; gap: 4px 28px; align-items: flex-end; border-bottom: 1px solid var(--border); }
.seg { display: inline-flex; gap: 20px; }
.seg button {
  font: inherit; font-size: 14px; border: 0; background: none; color: var(--muted);
  padding: 6px 0 8px; margin-bottom: -1px; cursor: pointer;
  border-bottom: 1.5px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.range-chg { font-size: 13px; font-variant-numeric: tabular-nums; margin-left: auto; padding-bottom: 8px; }
button:focus-visible, .table-wrap:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.chart { height: 210px; flex: 0 0 210px; min-height: 0; }

/* Table: hairlines, no boxes */
.table-wrap { flex: 1 1 auto; min-height: 120px; overflow-x: hidden; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead th { position: sticky; top: 0; background: var(--bg); z-index: 1; text-align: left; border-bottom: 1px solid var(--border); padding: 0; }
thead button {
  font: inherit; font-size: 12px; color: var(--muted); background: none; border: 0;
  padding: 8px; width: 100%; text-align: inherit; cursor: pointer; transition: color .15s ease;
}
thead button:hover, thead th[aria-sort] button { color: var(--ink); }
th.num, td.num { text-align: right; }
thead th[aria-sort="ascending"] button::after { content: " ↑"; }
thead th[aria-sort="descending"] button::after { content: " ↓"; }
td { padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--row-hover); }
td.c-name { overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
td.c-cat { color: var(--muted); }

.ftr { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; }

@media (max-width: 520px) {
  .c-cat { display: none; }
  .devx { padding: 16px 16px 12px; gap: 12px; }
  .value { font-size: 32px; }
  .hdr-value { width: 100%; justify-content: flex-start; }
  .asof { text-align: left; }
  .chart { height: 160px; flex-basis: 160px; }
  td.c-name { max-width: 110px; }
  .range-chg { margin-left: 0; width: 100%; padding-bottom: 6px; }
  .seg { gap: 14px; }
  .controls { gap: 4px 20px; }
}
@media (max-width: 400px) {
  .c-cap { display: none; }
}

/* Single-stock widget (stock.html): no table, the chart takes the free height */
.stock .chart { flex: 1 1 auto; height: auto; min-height: 160px; }

/* Compare widget (compare.html): legend with line samples */
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 14px; font-variant-numeric: tabular-nums; }
.legend li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.sw { display: inline-block; width: 22px; height: 0; border-top: 1.5px solid var(--ink); }
.sw-idx { border-top-width: 2px; }
.sw-dash { border-top: 1.5px dashed var(--muted); }
.sw-dot { border-top: 2px dotted var(--muted); }
.verdict { margin: -6px 0 0; font-size: 13px; color: var(--muted); }

/* Category widget (categories.html): 2x2 small multiples */
.cats { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 18px 28px; }
.cat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cat-hdr { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cat h2 { font-size: 15px; font-weight: inherit; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-chg { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-chart { flex: 1 1 auto; min-height: 60px; margin: 8px 0 6px; }
.cat-names { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.35; }
@media (max-width: 520px) {
  .cats { gap: 14px 16px; }
  .cat h2 { font-size: 13px; white-space: normal; }
  .cat-hdr { flex-direction: column; gap: 2px; }
  .cat-names { font-size: 11px; }
}
