.opportunity-screen-launcher {
  position: fixed;
  z-index: 90;
  right: max(78px, calc(env(safe-area-inset-right) + 58px));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid #806a34;
  border-radius: 50%;
  background: rgba(39, 36, 27, 0.94);
  box-shadow: 0 4px 12px rgba(25, 24, 19, 0.18);
  color: #fff4cf;
  cursor: grab;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.opportunity-screen-launcher::after {
  position: absolute;
  right: 2px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(39, 36, 27, 0.94);
  border-radius: 50%;
  background: #35b77c;
  content: "";
}

.opportunity-screen-launcher.has-unread::after {
  background: #b9343b;
}

.opportunity-screen-launcher:hover {
  border-color: #b59648;
  background: rgba(52, 47, 33, 0.97);
  box-shadow: 0 5px 14px rgba(25, 24, 19, 0.22);
}

.opportunity-screen-launcher.is-dragging {
  cursor: grabbing;
  transition: none;
}

.opportunity-screen-launcher:focus-visible,
.opportunity-screen-panel:focus-visible,
.opportunity-screen-header button:focus-visible,
.opportunity-screen-theme:focus-visible {
  outline: 2px solid #356f94;
  outline-offset: 2px;
}

.opportunity-screen-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #f3f4f1;
  border-radius: 12px;
  background: #b9343b;
  color: #fff;
  padding: 0 5px;
  font-size: 9px;
  line-height: 1;
}

.opportunity-screen-layer {
  position: fixed;
  z-index: 94;
  inset: 0;
}

.opportunity-screen-layer[hidden],
.opportunity-screen-empty[hidden],
.opportunity-screen-unread[hidden] {
  display: none;
}

.opportunity-screen-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(20, 24, 21, 0.3);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.opportunity-screen-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(720px, calc(100vw - 48px));
  height: min(650px, calc(100dvh - 48px));
  min-width: min(380px, calc(100vw - 32px));
  min-height: min(420px, calc(100dvh - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid rgba(143, 151, 145, 0.78);
  border-radius: 4px;
  background: rgba(243, 245, 243, 0.82);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  backdrop-filter: blur(22px) saturate(1.12);
  box-shadow: 0 14px 38px rgba(18, 24, 20, 0.2);
  color: #202722;
  outline: 0;
  overflow: hidden;
  resize: both;
  transform: translate(-50%, -50%);
}

.opportunity-screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(185, 193, 187, 0.9);
  background: rgba(250, 251, 249, 0.7);
  cursor: move;
  padding: 14px 16px 13px;
  touch-action: none;
  user-select: none;
}

.opportunity-screen-header > div {
  min-width: 0;
}

.opportunity-screen-header span {
  display: block;
  margin-bottom: 4px;
  color: #7a632d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.opportunity-screen-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.opportunity-screen-header p {
  margin: 6px 0 0;
  color: #59655e;
  font-size: 11px;
  line-height: 1.5;
}

.opportunity-screen-header button {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #bfc7c1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #303a34;
  cursor: pointer;
  font-size: 20px;
}

.opportunity-screen-header button:hover {
  border-color: #87938b;
  background: rgba(236, 239, 236, 0.92);
}

.opportunity-screen-status {
  min-height: 39px;
  margin: 0;
  border-bottom: 1px solid rgba(207, 213, 208, 0.9);
  background: rgba(238, 241, 238, 0.68);
  color: #59655e;
  padding: 10px 16px;
  font-size: 11px;
  line-height: 1.55;
}

.opportunity-screen-status.is-error {
  background: rgba(255, 239, 239, 0.84);
  color: #94343a;
}

.opportunity-screen-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

.opportunity-screen-record {
  display: grid;
  gap: 11px;
  margin-bottom: 10px;
  border: 1px solid rgba(195, 202, 197, 0.9);
  border-left: 3px solid #88713b;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
  padding: 12px;
}

.opportunity-screen-record.is-v-event {
  border-left-color: #356f94;
}

.opportunity-screen-record:last-child {
  margin-bottom: 0;
}

.opportunity-screen-record-head,
.opportunity-screen-stock-line,
.opportunity-screen-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.opportunity-screen-record-head {
  justify-content: space-between;
}

.opportunity-screen-record-head > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.opportunity-screen-record-head strong {
  font-size: 13px;
}

.opportunity-screen-record-head small,
.opportunity-screen-symbol,
.opportunity-screen-source {
  color: #68736c;
  font-size: 10px;
  line-height: 1.5;
}

.opportunity-screen-consensus,
.opportunity-screen-state,
.opportunity-screen-board {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #c2cac4;
  border-radius: 4px;
  background: #f2f4f2;
  color: #465149;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.opportunity-screen-consensus.is-confirmed,
.opportunity-screen-consensus.is-selected {
  border-color: #a7c8b5;
  background: #eaf5ee;
  color: #176b49;
}

.opportunity-screen-consensus.is-pending {
  border-color: #d9c27f;
  background: #fff8df;
  color: #745b16;
}

.opportunity-screen-consensus.is-rejected {
  border-color: #d5a6a8;
  background: #fff0f0;
  color: #94343a;
}

.opportunity-screen-stock-name {
  font-size: 15px;
  font-weight: 800;
}

.opportunity-screen-theme {
  min-height: 28px;
  border: 1px solid #b7c9d4;
  border-radius: 4px;
  background: #eef5f8;
  color: #295a76;
  cursor: pointer;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 750;
}

.opportunity-screen-theme:hover {
  border-color: #6f93a8;
  background: #e5f0f5;
}

.opportunity-screen-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.opportunity-screen-metrics div {
  min-width: 0;
  border-top: 1px solid #e1e5e1;
  padding-top: 8px;
}

.opportunity-screen-metrics span {
  display: block;
  margin-bottom: 3px;
  color: #69746d;
  font-size: 10px;
}

.opportunity-screen-metrics strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.opportunity-screen-metrics strong.is-positive {
  color: #b9343b;
}

.opportunity-screen-metrics strong.is-negative {
  color: #15704c;
}

.opportunity-screen-empty {
  grid-row: 3;
  align-self: center;
  justify-self: center;
  max-width: 440px;
  padding: 28px 20px;
  text-align: center;
}

.opportunity-screen-empty strong {
  font-size: 16px;
}

.opportunity-screen-empty p {
  margin: 8px 0 0;
  color: #68736c;
  font-size: 12px;
  line-height: 1.65;
}

body.opportunity-screen-open {
  overflow: hidden;
}

@media (max-width: 640px), (max-height: 520px) and (pointer: coarse) {
  .opportunity-screen-panel {
    inset: 0;
    width: 100vw !important;
    height: 100dvh !important;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    resize: none;
    transform: none !important;
  }

  .opportunity-screen-header {
    cursor: default;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 13px max(14px, env(safe-area-inset-left));
    touch-action: auto;
  }

  .opportunity-screen-list {
    padding: 10px max(10px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .opportunity-screen-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .opportunity-screen-launcher {
    transition: none;
  }
}
