/* Neva LED display — context and actions panel.
   Scoped to .neva-led-ctx. Tokens fall back to the owner's original notch
   (src/neva/notch.css: --notch-ink/-muted/-panel/-control-glass, #ffffff07
   hairline, 17px inner blocks, 7px home-grid gap), so the panel sits inside
   an original page without restyling; a shell can retune them with --led-*.
   --led-ctx-start reserves the original --notch-content-start gutter when the
   resident wave shares the page (default 0). Host it in a page with no glass
   of its own (like .notch-page-home) and a definite height. */
.neva-led-ctx {
  --ctx-ink: var(--led-ink, #f0f1f5);
  --ctx-muted: var(--led-muted, #a4a6b0);
  --ctx-panel: var(--led-panel, rgba(17, 21, 27, .57));
  --ctx-control: var(--led-control, rgba(15, 21, 27, .48));
  --ctx-line: var(--led-line, #ffffff07);
  --ctx-accent: var(--led-accent, #a9b9fc);
  --ctx-warn: var(--led-warn, #e4aa57);
  --ctx-error: var(--led-error, #f29b9b);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  /* The first row is content-sized but never takes more than 55%: in a short
     original page an auto row would squash Your work and Mail to nothing. */
  grid-template-rows: fit-content(55%) minmax(0, 1fr);
  container: neva-led-ctx / size;
  gap: 7px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding-inline-start: var(--led-ctx-start, 0px);
  color: var(--ctx-ink);
  font: 12px/1.4 var(--font-sans, "Inter", "SF Pro Display", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
.neva-led-ctx *, .neva-led-ctx *::before, .neva-led-ctx *::after { box-sizing: border-box; }
.neva-led-ctx__body { display: contents; }
.neva-led-ctx h3, .neva-led-ctx h4, .neva-led-ctx p, .neva-led-ctx ul { margin: 0; padding: 0; }

.neva-led-ctx__section {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 17px;
  background: var(--ctx-panel);
  border: 1px solid var(--ctx-line);
  scrollbar-width: thin;
}
.neva-led-ctx__where { grid-column: 1; grid-row: 1; }
.neva-led-ctx__work { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 8px; }
.neva-led-ctx__actions { grid-column: 2; grid-row: 1; }
.neva-led-ctx__mail { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
/* In a short original page the column sections scroll; their items keep
   their size (a flex column would otherwise squash cards and buttons). */
.neva-led-ctx__work > *, .neva-led-ctx__mail > * { flex-shrink: 0; }

.neva-led-ctx__eyebrow {
  font-size: 10px;
  letter-spacing: .02em;
  color: var(--ctx-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.neva-led-ctx__eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
}
.neva-led-ctx__title {
  margin-top: 4px !important;
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.neva-led-ctx__sub { color: var(--ctx-muted); font-size: 11px; margin-top: 2px !important; }

.neva-led-ctx button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  touch-action: manipulation;
}
.neva-led-ctx button:focus-visible { outline: 2px solid var(--ctx-accent); outline-offset: 2px; }
.neva-led-ctx button:disabled { cursor: not-allowed; opacity: .45; }

.neva-led-ctx__windows { list-style: none; display: grid; gap: 4px; margin-top: 8px !important; }
.neva-led-ctx__window { display: flex; gap: 3px; min-width: 0; }
.neva-led-ctx__window-key {
  flex: none;
  width: 26px;
  border-radius: 10px;
  color: var(--ctx-muted) !important;
  background: var(--ctx-control) !important;
  transition: background .2s, color .2s;
}
.neva-led-ctx__window-key:hover:not(:disabled) { color: var(--ctx-ink) !important; background: rgba(65, 76, 87, .46) !important; }
.neva-led-ctx__window-open {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 12px;
  background: var(--ctx-control);
  box-shadow: inset 0 1px rgba(255, 255, 255, .035);
  text-align: left;
  transition: background .2s;
}
.neva-led-ctx__window-open:hover { background: rgba(65, 76, 87, .46); }
.neva-led-ctx__window-open .neva-led-ctx__btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neva-led-ctx__window-state { color: var(--ctx-muted); font-size: 10px; flex: none; }
.neva-led-ctx__more { color: var(--ctx-muted); font-size: 10px; padding-left: 9px; }

.neva-led-ctx__card {
  padding: 9px 11px;
  border-radius: 14px;
  background: var(--ctx-control);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04);
  display: grid;
  gap: 3px;
}
.neva-led-ctx__card.is-focus .neva-led-ctx__eyebrow,
.neva-led-ctx__card.is-quiet .neva-led-ctx__eyebrow { color: var(--ctx-warn); }
.neva-led-ctx__card.is-proposal .neva-led-ctx__eyebrow { color: var(--ctx-accent); }
.neva-led-ctx__card-title { font-size: 12.5px; font-weight: 560; overflow-wrap: anywhere; }
.neva-led-ctx__countdown { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.neva-led-ctx__card-text, .neva-led-ctx__card-detail { color: var(--ctx-muted); font-size: 11px; }
.neva-led-ctx__btn {
  padding: 4px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  font-size: 11px;
  transition: background .2s;
}
.neva-led-ctx__btn:hover:not(:disabled) { background: rgba(255, 255, 255, .15); }

.neva-led-ctx__state { color: var(--ctx-muted); font-size: 11px; }
.neva-led-ctx__state.is-stale { color: var(--ctx-warn); }
.neva-led-ctx__state.is-error { color: var(--ctx-error); }

/* Neva actions: the lane 8 Tailark toolbar (.nled-actions/.nled-button),
   retoned here (only inside this panel) to the original notch inline actions:
   control glass, a 1px top highlight, 15px radius, light primary button and
   the original #a9b9fc focus ring. Anatomy, sizes and keyboard stay Tailark. */
.neva-led-ctx {
  --nled-ink: var(--ctx-ink);
  --nled-muted: var(--ctx-muted);
  --nled-panel: var(--ctx-panel);
  --nled-control-glass: var(--ctx-control);
  --nled-line: var(--ctx-line);
  --nled-ring: var(--ctx-accent);
  --nled-warning: var(--ctx-warn);
  --nled-danger: var(--ctx-error);
}
.neva-led-ctx .nled-button { border-radius: 15px; font-size: 11px; }
.neva-led-ctx .nled-button[data-variant="outline"] { background: var(--ctx-control); box-shadow: inset 0 1px #ffffff08; }
.neva-led-ctx .nled-button[data-variant="outline"]:hover:not(:disabled) { background: #ffffff15; }
.neva-led-ctx .nled-button[data-variant="default"] { background: #eceff1; color: #17181a; font-weight: 600; box-shadow: none; }
.neva-led-ctx .nled-button[data-variant="default"]:hover:not(:disabled) { background: #fff; }
.neva-led-ctx .nled-button:focus-visible { outline: 2px solid var(--ctx-accent); outline-offset: 2px; }
.neva-led-ctx__toolbar { margin-top: 7px; gap: 5px; }
.neva-led-ctx__mail > .nled-button, .neva-led-ctx__card > .nled-button { justify-self: start; align-self: flex-start; margin-top: 2px; }
.neva-led-ctx__btn-hint { font-size: 9.5px; color: var(--ctx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.neva-led-ctx__note { grid-column: 1 / -1; min-height: 0; font-size: 11px; color: var(--ctx-error); }
.neva-led-ctx__note:empty { display: none; }

/* The shell decides the panel's height. When it is short, keep every action
   reachable and drop the secondary lines first. */
@container neva-led-ctx (max-height: 240px) {
  .neva-led-ctx__section { padding: 8px 10px; }
  .neva-led-ctx__toolbar { margin-top: 5px; gap: 4px; }
  .neva-led-ctx__sub { display: none; }
  .neva-led-ctx__windows { margin-top: 5px !important; }
}

/* The original notch's shortest pages (home 198px, windows 252px overall)
   leave about 140-200px: tighter cards, and the countdown shrinks. */
@container neva-led-ctx (max-height: 170px) {
  .neva-led-ctx__section { padding: 6px 9px; }
  .neva-led-ctx__card { padding: 6px 9px; }
  .neva-led-ctx__countdown { font-size: 16px; }
  .neva-led-ctx__windows { gap: 3px; }
  .neva-led-ctx__window-open { padding: 3px 8px; }
}

/* Reduced motion: system preference or the original notch's Gentle motion
   (.is-calm on the notch root). */
@media (prefers-reduced-motion: reduce) {
  .neva-led-ctx * { transition: none !important; }
}
.is-calm .neva-led-ctx * { transition: none !important; }
