/* Home: speech bubble sits left of the top-right Ika. Absolute, so the hero column size does not change. */

.ika-knows-bubble {
  position: absolute;
  top: 2px;
  right: calc(100% + 10px);
  z-index: 2;
  display: block;
  width: max-content;
  max-width: min(210px, 46vw);
  margin: 0;
  padding: 8px 12px 8px 10px;
  border: none;
  border-radius: 14px 14px 4px 14px;
  background: #fffef8;
  color: #1e293b;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  pointer-events: auto;
}

.ika-knows-bubble::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 14px;
  border-width: 6px 0 6px 7px;
  border-style: solid;
  border-color: transparent transparent transparent #fffef8;
}

body.nav-open .ika-knows-bubble {
  visibility: hidden;
  pointer-events: none;
}

.ika-knows-modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  padding:
    calc(16px + env(safe-area-inset-top, 0px) + var(--clearli-top-inset-extra, 0px))
    calc(16px + env(safe-area-inset-right, 0px))
    calc(16px + env(safe-area-inset-bottom, 0px))
    calc(16px + env(safe-area-inset-left, 0px));
  background: rgba(15, 23, 42, 0.45);
}

.ika-knows-sheet {
  width: min(440px, 100%);
  max-height: min(78vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  margin: 0;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: #fffef8;
  color: #1e293b;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
}

.ika-knows-sheet h2 {
  margin: 0 28px 10px 0;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.ika-knows-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.ika-knows-sheet {
  position: relative;
}

.ika-knows-lines {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ika-knows-lines li {
  margin: 0 0 8px;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1e293b;
}

.ika-knows-ask {
  margin-top: 8px;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: #1d4ed8;
  color: #fff;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.journal-meal-streak {
  margin: 0 1.1rem 0.35rem;
  font-size: 0.78rem;
  color: var(--dash-muted, #64748b);
  line-height: 1.4;
}

.bento-sniff-shelf {
  grid-column: 1 / -1;
}

.ika-shelf-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #3b0764;
}

.ika-shelf-row:last-child {
  margin-bottom: 0;
}

.ika-shelf-score {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #3b0764;
}

.ika-shelf-add {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.68rem;
  cursor: pointer;
}

.ika-shelf-worst {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #3b0764;
}

body.night-mode .ika-shelf-row,
body.night-mode .ika-shelf-score,
body.night-mode .ika-shelf-worst {
  color: #e9d5ff;
}

@media (max-height: 560px) {
  .ika-knows-sheet {
    max-height: min(88dvh, 100%);
  }
}
