/*
 * The web app's look. The colours, the type and the radii are the phone app's
 * own (mobile/src/theme.ts): quiet graphite surfaces, Geist, one amber for
 * where a person's alert happened, and the whistle's green for Whistle itself.
 * Every gap and fixed height is a step on the 4px grid.
 *
 * Motion is the phone app's too (`motion` in mobile/src/theme.ts): one curve
 * for whatever moves into its place and two durations. The chart's line is
 * drawn in by the page itself (chart.tsx). Everything that moves is on show
 * before it moves and after, so a motion that never runs hides nothing.
 */
@font-face {
  font-family: 'Geist';
  src: url('/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/geist-mono.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #141415;
  --card: #19191b;
  --raised: #232325;
  --hair: rgba(237, 237, 237, 0.08);
  --hover: rgba(237, 237, 237, 0.035);
  --ring: rgba(237, 237, 237, 0.6);
  --text: #ededed;
  --second: #a1a1a6;
  --muted: #85858b;
  --accent: #d28e05;
  --pos: #4cc38a;
  --neg: #e5484d;
  --ai: #1eb482;
  --ai-light: #5fe0b1;
  /* The field in the rail: its ground before it is first painted, and the two tones words take on it. */
  --field-ground: #04140e;
  --on-field: #f2fbf6;
  --on-field-quiet: #a6dcc5;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --row: 40px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* A touch answered, and something leaving. */
  --press: 140ms;
  /* Something arriving, opening or going from one place to another. */
  --shift: 280ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body,
#root {
  height: 100%;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 14px/20px var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p,
ul {
  margin: 0;
  padding: 0;
  font-weight: 400;
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.pos {
  color: var(--pos);
}
.neg {
  color: var(--neg);
}
.ic {
  flex: none;
  display: block;
}

/* --- The shell: a sidebar, the list, and a stock open beside it --- */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  overflow: hidden;
}
.app.open {
  grid-template-columns: 224px minmax(0, 1fr) clamp(400px, 36%, 488px);
}
.side {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--hair);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}
/*
  The rail is the field: the moving ground of fine emerald lines that the
  store's film and the website stand on, painted on a canvas behind the rail's
  entries (ground.tsx). Its words take the field's own two tones. A screen too
  narrow for a rail has a bar across its top, and that stays plain.
*/
.railField {
  display: none;
}
@media (min-width: 901px) {
  .side {
    isolation: isolate;
    background: var(--field-ground);
  }
  .railField {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  .side .navAt {
    background: rgba(170, 240, 208, 0.12);
  }
  .side .nav,
  .side .nav .n,
  .side .who {
    color: var(--on-field-quiet);
  }
  .side .nav:hover {
    color: var(--on-field);
    background: rgba(170, 240, 208, 0.07);
  }
  .side .nav[aria-current='page'],
  .side .nav[aria-current='page']:hover {
    color: var(--on-field);
    background: none;
  }
  .side .nav[aria-current='page'] .n {
    color: var(--on-field);
  }
}
.brand {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
/* A place kept for the logo: an empty box of the size the logo has there. */
.markPlace {
  flex: none;
  width: 76px;
  height: 76px;
}
.markPlace.stage {
  width: 112px;
  height: 112px;
}
/*
 * The logo: the app's own whistle. It floats over the page and is moved to the place kept for it, which the
 * page works out. Where it stands here is the rail's place, so it is there before anything has run. Going
 * from one place to another it travels; keeping to a place as the window changes it does not.
 */
.logo {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 5;
  width: 76px;
  height: 76px;
  transform-origin: 0 0;
  transform: translate(74px, 12px);
  pointer-events: none;
}
.logo.travels {
  transition: transform 420ms var(--ease);
}
.logo svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
/* The surface under the current entry. One piece, which slides to the entry gone to. */
.navAt {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 8px;
  background: var(--raised);
  pointer-events: none;
}
.navAt.travels {
  transition: transform var(--shift) var(--ease);
}
.nav {
  position: relative;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--second);
  font-weight: 500;
  transition:
    background-color var(--press) var(--ease),
    color var(--press) var(--ease);
}
.nav:hover {
  color: var(--text);
  background: var(--hover);
}
.nav[aria-current='page'],
.nav[aria-current='page']:hover {
  color: var(--text);
  background: none;
}
.nav .n {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.nav[aria-current='page'] .n {
  color: var(--second);
}
.sideFoot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.who {
  padding: 0 10px 4px 36px;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
}
/* With little room beside an open stock, a row says what its alert says and leaves the alert's name to the panel. */
@container (max-width: 520px) {
  .tbl .an {
    display: none;
  }
}
/* With little room, on a phone or beside an open stock, a stock's row is its logo and ticker: a name cut to a letter or
   two says nothing. The cell's own tooltip has the whole name. */
@container (max-width: 700px) {
  .view .tbl .nm {
    display: none;
  }
}
.panel {
  border-left: 1px solid var(--hair);
  background: var(--card);
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: slide var(--shift) var(--ease);
}
@keyframes slide {
  from {
    transform: translateX(16px);
  }
}
.app.leaving .panel {
  animation: leave 160ms var(--ease) forwards;
}
@keyframes leave {
  to {
    transform: translateX(16px);
    opacity: 0;
  }
}
/* The list the person is on. It rises into place as it is gone to. */
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: rise var(--shift) var(--ease);
}
/*
 * It only moves. Fading a whole list in as well left its text soft in Chrome once the fade was over, for as
 * long as the list stood: the drawing kept for the fade was never made again. A move leaves nothing behind.
 */
@keyframes rise {
  from {
    transform: translateY(6px);
  }
}
/* On a first visit the page is read from its top, so it scrolls as one. */
.main.first {
  overflow-y: auto;
}
.main.first .view {
  flex: none;
}
.main.first .scroll {
  overflow: visible;
}

/* --- Buttons and fields --- */
.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    background-color var(--press) var(--ease),
    opacity var(--press) var(--ease),
    transform var(--press) var(--ease);
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--text);
  color: var(--page);
}
.btn.primary:hover:not(:disabled) {
  background: #ffffff;
}
.btn.quiet {
  background: var(--raised);
  color: var(--text);
}
.btn.quiet:hover:not(:disabled) {
  background: #2b2b2e;
}
.btn.danger {
  background: var(--neg);
  color: var(--page);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn.small {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 6px;
  gap: 6px;
}
/* A key of the keyboard that does what the control beside it does. */
.key {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(237, 237, 237, 0.14);
  font: 500 11px/20px var(--mono);
  color: var(--muted);
  text-align: center;
}
.box:focus-within .key,
.box input:not(:placeholder-shown) ~ .key {
  display: none;
}
@media (hover: none), (max-width: 900px) {
  .key {
    display: none;
  }
}
.link {
  color: var(--second);
  font-weight: 500;
  font-size: 13px;
  border-radius: 4px;
  transition: color var(--press) var(--ease);
}
.link:hover {
  color: var(--text);
}
.field {
  height: 32px;
  padding: 0 10px;
  background: var(--page);
  border: 1px solid var(--hair);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  min-width: 0;
}
.field:focus,
.find input:focus {
  outline: none;
  border-color: rgba(237, 237, 237, 0.28);
}
.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--page);
  border: 1px solid var(--hair);
  border-radius: 10px;
}
.seg button {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--second);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  transition:
    background-color var(--press) var(--ease),
    color var(--press) var(--ease);
}
.seg button:hover {
  color: var(--text);
}
.seg button[aria-pressed='true'],
.seg button[aria-expanded='true'] {
  background: var(--raised);
  color: var(--text);
}
.seg .n {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* --- The box an alert is written in --- */
.composer {
  padding: 16px 24px;
  border-bottom: 1px solid var(--hair);
}
.composerHead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.composerHead label {
  font-weight: 500;
}
.composerHead span {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 5px 5px 5px 14px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 12px;
  transition: border-color var(--press) var(--ease);
}
.box:focus-within {
  border-color: rgba(237, 237, 237, 0.28);
}
.box input {
  flex: 1;
  min-width: 0;
  height: 36px;
  background: none;
  border: 0;
  outline: none;
  font-size: 15px;
  caret-color: var(--accent);
}
.box input::placeholder,
.find input::placeholder {
  color: var(--muted);
}
/* While the AI reads, the box's edge is lit in the whistle's green and a band of light sweeps along it. */
.box.reading {
  border-color: rgba(30, 180, 130, 0.5);
}
.box.reading::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--ai-light), transparent) 0 0 / 40% 100% no-repeat;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: sweep 900ms linear infinite;
}
@keyframes sweep {
  from {
    background-position: -70% 0;
  }
  to {
    background-position: 170% 0;
  }
}
/* A first visit: the whistle large over the box, and what Whistle is for. */
.start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 0 24px;
}
.start h1 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 500;
  text-align: center;
  text-wrap: balance;
}
/*
 * Help with the words: whole examples, and the parts an alert is built from (menus.tsx).
 * Each is a button that drops a list of names down over what is under the box, the way the
 * stock search in a result does. The sentence a name stands for is in a box beside it.
 */
.help {
  position: relative;
  margin-top: 10px;
}
.helpTop {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.clash {
  color: var(--second);
  font-size: 13px;
}
.menus {
  display: flex;
  gap: 6px;
}
.menuAt {
  position: relative;
}
.menuOpen {
  height: 30px;
  padding: 0 8px 0 11px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(237, 237, 237, 0.05);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--press) var(--ease);
}
.menuOpen:hover {
  background: rgba(237, 237, 237, 0.09);
}
.menuOpen[aria-expanded='true'] {
  background: var(--raised);
}
.menuOpen .ic {
  color: var(--muted);
  transition:
    transform var(--shift) var(--ease),
    color var(--press) var(--ease);
}
.menuOpen:hover .ic,
.menuOpen[aria-expanded='true'] .ic {
  color: var(--text);
}
.menuOpen[aria-expanded='true'] .ic {
  transform: rotate(180deg);
}
.menuOpen .n {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(237, 237, 237, 0.1);
  font: 500 11px/18px var(--mono);
  color: var(--text);
  text-align: center;
}
.wordsMenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 6;
  width: max-content;
  min-width: 232px;
  max-height: min(392px, calc(100vh - 160px));
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  padding: 4px;
  background: var(--raised);
  border: 1px solid rgba(237, 237, 237, 0.1);
  border-radius: 10px;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  animation: rise var(--press) var(--ease);
}
.choice {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background-color var(--press) var(--ease);
}
.choice:hover:not(:disabled),
.choice:focus-visible {
  background: rgba(237, 237, 237, 0.07);
}
.choice:focus-visible {
  outline: none;
}
.choice:disabled {
  cursor: default;
  opacity: 0.5;
}
.choice .cn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.choice .ct {
  font-weight: 500;
  white-space: nowrap;
}
/* The sentence: read with the name, and seen in the box beside the list. In a told list it stands under the name. */
.choice .cd {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  color: var(--second);
  font-size: 13px;
  line-height: 18px;
}
.told .choice {
  padding: 8px 10px;
  align-items: flex-start;
}
.told .choice .cd {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  text-wrap: pretty;
}
.told .choice .tick,
.told .choice > .ic {
  margin-top: 1px;
}
.choice > .ic {
  flex: none;
  color: var(--text);
}
.choice .tick {
  flex: none;
}
.choice:hover:not(:disabled) .tick:not(.on) {
  box-shadow: inset 0 0 0 1.5px rgba(237, 237, 237, 0.5);
}
/* One line of it is as tall as a row of the list, so it stands level with the name it tells of. */
.wordHint {
  position: absolute;
  z-index: 7;
  width: max-content;
  padding: 8px 12px;
  background: var(--raised);
  border: 1px solid rgba(237, 237, 237, 0.1);
  border-radius: 10px;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  text-wrap: pretty;
  pointer-events: none;
  transition: top var(--shift) var(--ease);
  animation: beside var(--press) var(--ease);
}
@keyframes beside {
  from {
    transform: translateX(-6px);
  }
}
.said {
  margin-top: 10px;
  font-size: 13px;
  color: var(--second);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.seen {
  color: var(--second);
  font-size: 13px;
  margin-bottom: 4px;
}

/* The AI's green on what the AI did: "Our AI read", "Our AI saw". */
.ai {
  color: var(--ai-light);
  margin-right: 8px;
  font-size: 13px;
  font-weight: 500;
}

/*
 * What an idea came to, under the box. It has the column to itself while it is open, and the column scrolls as one.
 * Left, the stocks with what it did on each; right, the one picked, drawn. In a narrow column the drawing goes on top.
 */
.main.testing {
  overflow-y: auto;
}
/* With the list stepped aside there is nothing under the box to keep apart from it. */
.main.testing .composer {
  border-bottom: 0;
  padding-bottom: 24px;
}
.result {
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 12px;
  animation: rise var(--shift) var(--ease);
}
.result:focus {
  outline: none;
}
.resultRead {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hair);
}
.resultRead p {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 22px;
}
.resultRead .link {
  flex: none;
}
.resultBody {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 36%, 420px);
}
.resultList {
  min-width: 0;
  padding: 16px 0 0;
  border-right: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
}
/*
 * The list stands as tall as the drawing beside it, and scrolls inside past that, so a long watchlist never
 * pushes the button that keeps the alert out of reach. It is sized as if it held nothing (`contain: size`),
 * which leaves the height of the row to the drawing, and then fills what is left of it.
 */
.resultScroll {
  flex: 1 1 0;
  min-height: 232px;
  overflow-y: auto;
  contain: size;
  overscroll-behavior: contain;
}
.resultSlow {
  padding: 4px 16px 0;
  color: var(--muted);
  font-size: 12px;
}
.resultShown {
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.resultHead {
  padding: 0 16px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.resultHead h2 {
  font-size: 17px;
  line-height: 24px;
  font-weight: 500;
  text-wrap: balance;
}
.resultWhen {
  color: var(--muted);
  font-size: 12px;
}
.tryOn {
  position: relative;
  max-width: 372px;
  padding: 12px 16px 8px;
}
.tryList {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 48px;
  z-index: 3;
  padding: 4px;
  background: var(--raised);
  border: 1px solid rgba(237, 237, 237, 0.1);
  border-radius: 10px;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  animation: rise var(--press) var(--ease);
}
.tryList button {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  text-align: left;
  white-space: nowrap;
}
.tryList button[aria-selected='true'] {
  background: rgba(237, 237, 237, 0.06);
}
.tryList .nm {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tryList .act {
  margin-left: auto;
  padding-left: 12px;
  color: var(--muted);
  font-size: 12px;
}
.tryNote {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}
/* The heads stay at the top of the list while it scrolls under them. */
.resultTbl th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
}
.resultTbl th:first-child,
.resultTbl td:first-child {
  padding-left: 16px;
}
.resultTbl th:last-child,
.resultTbl td:last-child {
  padding-right: 16px;
}
.resultTbl tbody tr:last-child td {
  border-bottom: 0;
}
.resultTbl .quiet {
  color: var(--muted);
}
.resultTbl .fresh {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}
.resultTbl .watch {
  text-align: center;
}
/* A tick: the alert watches this stock. */
.tick {
  appearance: none;
  margin: 0;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  cursor: pointer;
  box-shadow: inset 0 0 0 1.5px rgba(237, 237, 237, 0.28);
  transition:
    background-color var(--press) var(--ease),
    box-shadow var(--press) var(--ease);
}
.tick:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1.5px rgba(237, 237, 237, 0.5);
}
.tick::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--page);
  border-bottom: 2px solid var(--page);
  border-radius: 1px;
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform var(--press) var(--ease);
}
.tick:checked,
.tick.on {
  background: var(--text);
  box-shadow: none;
}
.tick:checked::after,
.tick.on::after {
  transform: translateY(-1px) rotate(-45deg) scale(1);
}
.tick:disabled {
  opacity: 0.35;
  cursor: default;
}
.tick:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.verdict {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.verdictName {
  display: flex;
  align-items: center;
}
.verdictName b {
  font-weight: 500;
}
/* One height whatever it says, so the drawing under it stays put. */
.verdictBody {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.figs {
  display: flex;
  gap: 32px;
}
.figs p {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.figs small {
  color: var(--muted);
  font-size: 12px;
}
.figs strong {
  font: 500 26px/32px var(--mono);
  font-variant-numeric: tabular-nums;
}
.figs .mine,
.verdictCount strong {
  color: var(--accent);
}
.verdictCount {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.verdictCount strong {
  font: 500 30px/36px var(--mono);
  font-variant-numeric: tabular-nums;
}
.verdictCount span {
  color: var(--second);
}
.verdictLine {
  color: var(--second);
  font-size: 13px;
  line-height: 20px;
}
.result .chart {
  height: 200px;
}
.legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
.legend .filled {
  background: var(--accent);
}
.legend .open {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.resultNote {
  padding: 12px 16px 0;
  border-top: 1px solid var(--hair);
  color: var(--second);
  font-size: 13px;
}
.resultFoot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--hair);
}
.resultNote + .resultFoot {
  border-top: 0;
}
.nameLabel {
  margin-right: 4px;
  color: var(--muted);
  font-size: 13px;
}
.resultFoot .field {
  width: 200px;
}
.resultOn {
  min-width: 0;
  margin: 0 8px 0 auto;
  color: var(--second);
  font-size: 13px;
  text-align: right;
}
/* Where the list's column is narrow a row is its logo and ticker: a name cut to three letters says nothing. The row's
   own tooltip has the whole name, and the drawing beside it names the stock picked. */
@container (max-width: 1000px) {
  .resultTbl .nm,
  .resultTbl .fresh {
    display: none;
  }
}
@container (max-width: 760px) {
  .resultBody {
    grid-template-columns: minmax(0, 1fr);
  }
  /* With the drawing above it there is nothing beside the list to match: it is eight rows tall, and scrolls past that. */
  .resultScroll {
    flex: none;
    min-height: 0;
    max-height: 352px;
    contain: none;
  }
  .resultShown {
    order: -1;
    border-bottom: 1px solid var(--hair);
  }
  .resultList {
    border-right: 0;
  }
}
@container (max-width: 560px) {
  .resultTbl .roomy,
  .resultTbl .fresh {
    display: none;
  }
  .resultRead {
    flex-direction: column;
    gap: 4px;
  }
  .resultFoot .field {
    flex: 1;
    width: auto;
  }
  .resultOn {
    flex-basis: 100%;
    order: 1;
    margin: 0;
    text-align: left;
  }
  .resultFoot .btn {
    order: 2;
    flex: 1;
  }
}

/* --- Tables --- */
.head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px 8px;
  min-height: 56px;
}
.head h2 {
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
}
.head .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.headLine {
  color: var(--muted);
  font-size: 13px;
  margin-left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.headEnd {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.find {
  position: relative;
  color: var(--muted);
  display: block;
}
.find .ic {
  position: absolute;
  left: 10px;
  top: 8px;
}
.find input {
  width: 200px;
  height: 32px;
  padding: 0 10px 0 34px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
}
.find.wide input {
  width: 100%;
}
.app.open .find:not(.wide) input {
  width: 150px;
}
.scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.tbl th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--page);
  height: 32px;
  padding: 0 12px;
  text-align: left;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}
/* A heading that puts the list in order of its column. Its arrow has its room kept, so nothing moves when it comes. */
.sort {
  height: 24px;
  margin: 0 -6px;
  padding: 0 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
  color: inherit;
  transition: color var(--press) var(--ease);
}
.num .sort {
  flex-direction: row-reverse;
}
.sort:hover,
th[aria-sort='ascending'] .sort,
th[aria-sort='descending'] .sort {
  color: var(--text);
}
.sort .arrow {
  opacity: 0;
  transition: opacity var(--press) var(--ease);
}
.sort:hover .arrow {
  opacity: 0.5;
}
.sort .arrow.on {
  opacity: 1;
}
.tbl td {
  height: var(--row);
  padding: 0 12px;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}
.tbl th:first-child,
.tbl td:first-child {
  padding-left: 24px;
}
.tbl th:last-child,
.tbl td:last-child {
  padding-right: 24px;
}
.tbl .num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.tbl th.num {
  font-family: var(--sans);
  font-size: 12px;
}
.tbl .fit {
  width: 1%;
  max-width: none;
}
.tbl .right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tbl tbody tr {
  cursor: pointer;
  transition: background-color var(--press) var(--ease);
}
.tbl tbody tr:hover {
  background: var(--hover);
}
.tbl tbody tr[aria-selected='true'] {
  background: var(--raised);
}
.tbl tbody tr:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}
.tbl tbody tr.plain {
  cursor: default;
}
.tbl tbody tr.plain:hover {
  background: none;
}
/*
 * A stock's logo, from Brandfetch, before its ticker (logo.tsx). Until it is in, or where there is none, the ticker's
 * first letter stands on a quiet tile. A light disc behind the logo shows only where the logo is see-through, so a
 * dark shape on nothing does not vanish on the dark page.
 */
.stockLogo {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  margin-right: 10px;
  vertical-align: middle;
  overflow: hidden;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.stockLetter {
  font-family: var(--mono);
  font-weight: 500;
  line-height: 1;
  color: var(--second);
}
.stockLogo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.stockLogo.in {
  background: none;
  box-shadow: none;
}
.stockLogo.in::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #f2f2f2;
}
.stockLogo.bare img {
  inset: 25%;
  width: 50%;
  height: 50%;
}
.tk {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  display: inline-block;
  min-width: 52px;
}
.nm {
  color: var(--second);
}
.an {
  color: var(--second);
  margin-right: 10px;
}
.st {
  font-weight: 500;
}
.st.q {
  font-weight: 400;
  color: var(--muted);
}
.none {
  color: var(--muted);
}
.when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* What Whistle has told and the person has not read yet. */
tr.new .when,
tr.new .an,
tr.new .nm {
  color: var(--text);
}
tr.new .tk,
tr.new .an {
  font-weight: 500;
}
/* A bar where a figure will be, while it is on its way. It breathes, to say that something is coming. */
.bar {
  display: inline-block;
  height: 10px;
  border-radius: 3px;
  background: rgba(237, 237, 237, 0.1);
  vertical-align: middle;
  animation: breathe 1200ms ease-in-out infinite alternate;
}
@keyframes breathe {
  to {
    opacity: 0.45;
  }
}
/* A figure that changed says which way it went, then goes back to its own colour. */
.went.up {
  animation: wentUp 1400ms ease-in;
}
.went.down {
  animation: wentDown 1400ms ease-in;
}
@keyframes wentUp {
  from {
    color: var(--pos);
  }
}
@keyframes wentDown {
  from {
    color: var(--neg);
  }
}
.btn.again {
  min-width: 108px;
}
.empty {
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}
.foot {
  padding: 12px 24px;
  color: var(--muted);
  font-size: 13px;
}
.foot.flush {
  padding: 8px 0 0;
}
.ask {
  display: inline-flex;
  gap: 6px;
}

/* Finding a stock to add. */
.add {
  padding: 4px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--hair);
}
.addNote {
  color: var(--muted);
  font-size: 13px;
}
.found {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.found li {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
}
.found .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- A stock, open beside the list --- */
.record {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* The name and the graph stay where they are while the lists under them scroll. */
.recFixed {
  flex: none;
  padding: 20px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-bottom: 1px solid var(--hair);
}
.recLists {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
/* With little height the graph would leave the lists no room, so the panel scrolls as one. */
@media (max-height: 760px), (max-width: 900px) {
  .record {
    overflow: auto;
  }
  .recFixed {
    border-bottom: 0;
    padding-bottom: 4px;
  }
  .recLists {
    flex: none;
    overflow: visible;
  }
}
.recTop {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.recName {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.recName .stockLogo {
  margin-right: 0;
}
.recNames {
  min-width: 0;
}
.recName .tk {
  color: var(--muted);
  min-width: 0;
  display: block;
  line-height: 16px;
}
.recName h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recPrice {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}
.recPrice .p {
  font-family: var(--mono);
  font-size: 20px;
  line-height: 28px;
  font-variant-numeric: tabular-nums;
  display: block;
}
.recPrice .d {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  display: block;
}
.graph {
  position: relative;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--page);
  padding: 10px 4px 8px 12px;
}
.graphTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-right: 4px;
}
.readout {
  height: 32px;
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--second);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.readout b {
  font-weight: 500;
  color: var(--text);
  margin-left: 10px;
}
.chart {
  height: 232px;
  touch-action: pan-y;
}
.chart svg {
  display: block;
  width: 100%;
  height: 100%;
}
.chart text {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart .grid {
  stroke: rgba(237, 237, 237, 0.07);
  stroke-width: 1;
}
/* Where the line will be, while prices are on their way. */
.chart .level {
  stroke: rgba(237, 237, 237, 0.14);
  stroke-width: 1.5;
  stroke-linecap: round;
  animation: breathe 1200ms ease-in-out infinite alternate;
}
.chart .price {
  fill: none;
  stroke: var(--text);
  stroke-opacity: 0.86;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
/* Where the signal bought or happened, and where it sold. */
.chart .mark.filled {
  fill: var(--accent);
  stroke: var(--page);
  stroke-width: 2;
}
.chart .mark.open {
  fill: var(--page);
  stroke: var(--accent);
  stroke-width: 2;
}
.chart .now {
  fill: var(--text);
}
.chart .cursor {
  stroke: rgba(237, 237, 237, 0.28);
  stroke-width: 1;
}
.chart .cursorDot {
  fill: var(--page);
  stroke: var(--text);
  stroke-width: 1.5;
}
.now {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 32px;
  padding: 6px 8px 0 0;
  font-size: 13px;
  color: var(--second);
}
p.now i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
p.now i.open {
  background: var(--page);
  border: 2px solid var(--accent);
}
p.now i.gap {
  margin-left: 8px;
}
p.now b {
  font-weight: 500;
  color: var(--text);
}
p.now .st {
  margin-left: auto;
  padding-left: 12px;
}
/* It has the room of its two lines kept, so the card is one height whatever it says and while it waits. */
.evidence {
  min-height: 42px;
  padding: 2px 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.sub h3 {
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  margin-bottom: 4px;
}
.sub .tbl {
  width: calc(100% + 16px);
  margin: 0 -8px;
}
.sub .tbl td,
.sub .tbl td:first-child,
.sub .tbl td:last-child {
  padding: 0 8px;
  height: 36px;
}
.bell {
  height: 26px;
  padding: 0 8px 0 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px rgba(237, 237, 237, 0.12);
}
.bell[aria-pressed='false'] {
  color: var(--muted);
  background: none;
  box-shadow: inset 0 0 0 1px var(--hair);
}
.bell[aria-pressed='false']:hover:not(:disabled) {
  color: var(--text);
}
.bell:disabled {
  opacity: 0.45;
  cursor: default;
}
.hint {
  color: var(--second);
  font-size: 13px;
}
.recFoot {
  padding-top: 4px;
}

/* --- Account --- */
.account {
  padding: 24px;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: auto;
}
.account h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.account h3 {
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  margin-bottom: 4px;
}
.account p {
  color: var(--second);
  max-width: 56ch;
}
.account .btn {
  margin-top: 12px;
}
.legal {
  margin-top: 8px;
  display: flex;
  gap: 16px;
}
.remark {
  margin-top: 8px;
  font-size: 13px;
}

/* --- What Whistle told the person while the page was open --- */
.note {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  width: min(360px, calc(100vw - 32px));
  padding: 12px 14px 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--raised);
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 1px rgba(237, 237, 237, 0.1),
    0 12px 28px rgba(0, 0, 0, 0.5);
  animation: rise var(--shift) var(--ease);
}
.noteOpen {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  border-radius: 6px;
}
.noteTop {
  display: flex;
  align-items: center;
  gap: 4px;
}
.noteTop .stockLogo {
  margin-right: 6px;
}
.noteSub {
  color: var(--second);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- A narrow window: the sidebar becomes a bar, and an open stock takes the page --- */
@media (max-width: 900px) {
  .app,
  .app.open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .side {
    background: none;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
    border-right: 0;
    border-bottom: 1px solid var(--hair);
    overflow-x: auto;
  }
  .brand {
    height: 40px;
    margin: 0 4px 0 0;
  }
  .markPlace.rail {
    width: 44px;
    height: 44px;
  }
  .markPlace.stage {
    width: 88px;
    height: 88px;
  }
  .logo {
    transform: translate(12px, 6px) scale(0.58);
  }
  .start {
    padding: 4px 0 16px;
  }
  .start h1 {
    font-size: 20px;
    line-height: 28px;
  }
  .note {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }
  .sideFoot {
    margin: 0 0 0 auto;
  }
  .who,
  .nav .ic {
    display: none;
  }
  .app.open .main {
    display: none;
  }
  .panel {
    border-left: 0;
  }
  .composer,
  .head,
  .recFixed,
  .recLists,
  .account {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .tbl th:first-child,
  .tbl td:first-child {
    padding-left: 16px;
  }
  .tbl th:last-child,
  .tbl td:last-child {
    padding-right: 16px;
  }
  .composerHead span,
  .headLine {
    display: none;
  }
  .find input {
    width: 132px;
  }
}
/* On a phone the box is two rows: the words have its whole width, and its two buttons share the row under them. */
@media (max-width: 600px) {
  .menuAt {
    position: static;
  }
  .wordsMenu {
    right: 0;
    width: auto;
  }
  .box {
    flex-wrap: wrap;
    padding: 5px;
  }
  .box input {
    flex: 1 1 100%;
    padding: 0 9px;
  }
  .box .btn {
    flex: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
