/* Inbox for Linear. Space Grotesk (OFL) throughout; sizes are for a 2560x720 panel read from arm's length. */
@font-face {
  font-family: 'IFL Grotesk';
  src: url('../resources/fonts/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-display: block;
}

:root {
  --ink: #eceef2;
  --mark: #f2b84b;
  --paper: #0f1115;
  --paper-alpha: 1;
  --late: #ff6b5e;
  --cols: 1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: transparent; }
body { font-family: 'IFL Grotesk', 'Segoe UI', sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }

.lx {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 32px;
  padding: 26px 32px 14px;
}
.lx-paper {
  position: absolute; inset: 0; z-index: -1;
  background: var(--paper); opacity: var(--paper-alpha);
}


.lx[data-cols="3"] { grid-template-columns: 360px minmax(0, 1fr); }

/* vertical slots: the tally becomes a strip on top */
.lx[data-tall="1"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  row-gap: 18px;
}

/* ---- tally ---- */
.lx-tally { grid-column: 1; grid-row: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.lx-when { font-size: 24px; font-weight: 500; opacity: 0.62; letter-spacing: 0.01em; white-space: nowrap; }
.lx-big { display: flex; align-items: baseline; gap: 12px; margin-top: 2px; line-height: 1; }
.lx-big span { font-size: 112px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--mark); }
.lx-big small { font-size: 26px; font-weight: 500; opacity: 0.8; white-space: nowrap; }
.lx-facts { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.lx-fact { font-size: 24px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.86; }
.lx-fact.is-late { color: var(--late); opacity: 1; }
.lx-fact.is-mark { color: var(--mark); opacity: 1; }

.lx[data-tall="1"] .lx-tally { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 24px; align-items: end; }
.lx[data-tall="1"] .lx-when { grid-column: 1 / -1; }
.lx[data-tall="1"] .lx-big span { font-size: 96px; }
.lx[data-tall="1"] .lx-facts { margin-top: 0; padding-bottom: 8px; }

/* ---- lanes ---- */
.lx-lanes {
  grid-column: 2; grid-row: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: 30px;
}
.lx[data-tall="1"] .lx-lanes { grid-column: 1; grid-row: 2; }
.lx-lane { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.lx-list { list-style: none; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

.lx-head {
  display: flex; align-items: baseline; gap: 12px; flex: none;
  font-size: 20px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 10px 2px 8px; border-bottom: 2px solid color-mix(in srgb, var(--ink) 16%, transparent);
}
.lx-head:not(:first-child) { margin-top: 14px; }
.lx-head-name { opacity: 0.7; }
.lx-head-count { font-variant-numeric: tabular-nums; color: var(--mark); }
.lx-none { font-size: 22px; opacity: 0.45; padding: 14px 2px; flex: none; }

.lx-row {
  position: relative; flex: none;
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; align-items: center;
  padding: 12px 6px 12px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  border-radius: 6px;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.lx-row[role="button"] { cursor: pointer; }
.lx-row[role="button"]:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.lx-main { min-width: 0; }
.lx-top { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.lx-key { flex: none; font-size: 22px; font-weight: 500; opacity: 0.55; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.lx-title { flex: 1; min-width: 0; font-size: 28px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-meta { display: flex; gap: 16px; margin-top: 3px; font-size: 21px; white-space: nowrap; overflow: hidden; }
.lx-meta > span { overflow: hidden; text-overflow: ellipsis; }
.lx-state { opacity: 0.62; flex: none; }
.lx-due { flex: none; opacity: 0.85; }
.lx-due.is-today { color: var(--mark); opacity: 1; }
.lx-due.is-late { color: var(--late); opacity: 1; font-weight: 700; }
.lx-where { opacity: 0.45; min-width: 0; }
.lx-going { color: var(--mark); font-weight: 700; }

.lx-row.is-moving { background: color-mix(in srgb, var(--mark) 12%, transparent); }
.lx-row.is-done .lx-title { text-decoration: line-through; opacity: 0.5; }
.lx-row.is-done .lx-state { color: var(--mark); opacity: 1; }
.lx-countdown {
  position: absolute; left: 0; bottom: 0; height: 4px; width: 100%;
  background: var(--mark); transform-origin: left center;
  animation-name: lx-shrink; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes lx-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* priority: three rising bars, filled by level; urgent is a solid "!" tile */
.lx-pri { width: 34px; height: 30px; display: flex; align-items: flex-end; gap: 4px; justify-self: center; }
.lx-pri i { display: block; width: 8px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 20%, transparent); }
.lx-pri i:nth-child(1) { height: 40%; }
.lx-pri i:nth-child(2) { height: 70%; }
.lx-pri i:nth-child(3) { height: 100%; }
.lx-pri-2 i, .lx-pri-3 i:nth-child(-n+2), .lx-pri-4 i:nth-child(1) { background: var(--ink); }
.lx-pri-1 {
  align-items: center; justify-content: center; border-radius: 7px;
  background: var(--late); color: #120705; font-size: 24px; font-weight: 700; line-height: 1;
}

.lx-more { flex: none; font-size: 21px; opacity: 0.55; padding: 10px 2px 0; }
.is-cut { display: none !important; }

.lx-calm { justify-content: center; padding: 0 6px; grid-column: 1 / -1; }
.lx-calm-title { font-size: 40px; font-weight: 700; }
.lx-calm-body { font-size: 24px; opacity: 0.6; margin-top: 10px; }

/* ---- status line + notes ---- */
.lx-status {
  grid-column: 1 / -1; grid-row: 2; min-height: 26px;
  font-size: 19px; opacity: 0.45; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 8px;
}
.lx[data-tall="1"] .lx-status { grid-row: 3; }
.lx-status.is-warn { color: var(--mark); opacity: 0.95; }

.lx-note {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(86%, 900px); padding: 28px 32px; border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 88%, var(--ink));
  border: 2px solid color-mix(in srgb, var(--ink) 14%, transparent);
  display: flex; flex-direction: column; gap: 10px;
}
.lx-note b { font-size: 34px; font-weight: 700; color: var(--mark); }
.lx-note span { font-size: 24px; line-height: 1.35; opacity: 0.85; }
.lx[data-state="setup"] .lx-tally, .lx[data-state="error"] .lx-tally,
.lx[data-state="loading"] .lx-facts { visibility: hidden; }
.lx[data-state="setup"] .lx-status, .lx[data-state="error"] .lx-status { visibility: hidden; }
.lx-note[hidden] { display: none; }
/* single-line text clips itself (ellipsis): give descenders room so "g" and "y" are never shaved */
.lx-fact, .lx-title, .lx-key, .lx-meta, .lx-when, .lx-big small, .lx-status { line-height: 1.32; }
.lx-fact, .lx-when, .lx-big { flex: none; }   /* never squeeze a line: whole facts drop instead (see drawTally) */
/* narrow landscape slots (696 and 840 wide): smaller tally so issue titles keep their room */
.lx[data-narrow="1"][data-tall="0"] { grid-template-columns: 220px minmax(0, 1fr); column-gap: 24px; padding-left: 24px; padding-right: 24px; }
.lx[data-narrow="1"][data-tall="0"] .lx-big span { font-size: 92px; }
.lx[data-narrow="1"][data-tall="0"] .lx-when { font-size: 21px; }
.lx[data-narrow="1"][data-tall="0"] .lx-fact { font-size: 22px; }
.lx-meta > span { flex: none; }               /* overflowing items are removed whole by trimMeta() */
.lx[data-narrow="1"][data-tall="0"] .lx-big { flex-direction: column; align-items: flex-start; gap: 0; }
.lx[data-narrow="1"][data-tall="0"] .lx-big small { font-size: 23px; margin-top: 2px; }

/* vertical slots have height to spare: a long title may take two lines before it is cut */
.lx[data-tall="1"] .lx-title { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
