/* Shared create-alert dialog + Telegram link banner (used by Markets,
   Alerts, and Portfolio). Tokens fall back to the shared dark palette. */

.yam-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 9, 14, 0.66);
  backdrop-filter: blur(6px);
}

.yam-alert-dialog {
  width: min(560px, 100%);
  max-height: min(84vh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line, #303a4a);
  border-radius: 16px;
  background: var(--surface-raised, #1d2431);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.yam-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line, #303a4a);
}

.yam-alert-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.yam-alert-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line, #303a4a);
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #abb5c4);
  font-size: 1.1rem;
  line-height: 1;
}

.yam-alert-close:hover {
  color: var(--text, #f1f4f9);
  background: var(--surface-hover, #202836);
}

.yam-alert-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 20px;
  overflow-y: auto;
}

.yam-alert-help {
  margin: 0;
  color: var(--muted, #abb5c4);
  font-size: 0.9rem;
  line-height: 1.5;
}

.yam-alert-search-row {
  display: flex;
  gap: 10px;
}

.yam-alert-search-row input {
  flex: 1;
  min-width: 0;
}

.yam-alert-targets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yam-alert-target {
  padding: 11px 14px;
  border: 1px solid var(--line, #303a4a);
  border-radius: 12px;
  background: var(--surface, #171d28);
  color: var(--text, #f1f4f9);
  font-size: 0.9rem;
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease;
}

.yam-alert-target:hover {
  border-color: var(--line-strong, #465267);
  background: var(--surface-hover, #202836);
}

.yam-alert-target-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.yam-alert-target strong,
.yam-alert-target small {
  display: block;
}

.yam-alert-target small {
  margin-top: 3px;
  color: var(--muted, #abb5c4);
}

.yam-alert-continue {
  align-self: flex-end;
  margin-top: 4px;
}

.yam-alert-target.is-selected {
  border-color: color-mix(in srgb, var(--cobalt, #8299ef) 55%, var(--line, #303a4a));
  background: color-mix(in srgb, var(--cobalt, #8299ef) 10%, var(--surface, #171d28));
  cursor: default;
}

.yam-alert-change {
  align-self: flex-start;
}

.yam-alert-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--muted, #abb5c4);
}

.yam-alert-field span {
  font-weight: 600;
}

.yam-alert-multiselect {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line, #303a4a);
  border-radius: 10px;
  background: var(--surface, #171d28);
}

.yam-alert-multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted, #abb5c4);
  cursor: pointer;
}

.yam-alert-multiselect-option:hover {
  border-color: var(--line-strong, #3c485a);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text, #edf2f7);
}

.yam-alert-multiselect-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--cobalt, #8299ef) 45%, var(--line, #303a4a));
  background: color-mix(in srgb, var(--cobalt, #8299ef) 10%, var(--surface, #171d28));
  color: var(--text, #edf2f7);
}

.yam-alert-multiselect-option input {
  accent-color: var(--cobalt, #8299ef);
}

.yam-alert-params {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.yam-alert-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted, #abb5c4);
  font-size: 0.85rem;
  line-height: 1.45;
}

.yam-alert-check input {
  margin-top: 2px;
}

.yam-alert-field-help {
  margin-top: -8px;
  color: var(--faint, #7f8a9b);
  font-size: 0.77rem;
}

.yam-alert-direction {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--line, #303a4a);
  border-radius: 10px;
  overflow: hidden;
  align-self: flex-start;
}

.yam-alert-direction button {
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--muted, #abb5c4);
  font-size: 0.84rem;
  font-weight: 600;
}

.yam-alert-direction button[aria-pressed="true"] {
  background: var(--cobalt-soft, #202b4e);
  color: var(--cobalt-strong, #a6b6f7);
}

.yam-alert-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.yam-alert-actions > * {
  flex: 1 1 auto;
  white-space: nowrap;
}

/* --- Shared inputs/buttons (also used by the pages via this stylesheet) --- */

.yam-alert-overlay input[type="search"],
.yam-alert-overlay input[type="number"],
.yam-alert-overlay input[type="text"],
.yam-alert-overlay select,
.link-banner input {
  padding: 10px 12px;
  border: 1px solid var(--line, #303a4a);
  border-radius: 10px;
  background: var(--surface, #171d28);
  color: var(--text, #f1f4f9);
}

.yam-alert-overlay .primary-button,
.link-banner .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--cobalt, #8299ef);
  color: #0d1220;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: background 120ms ease, transform 120ms ease;
}

.yam-alert-overlay .primary-button:hover,
.link-banner .primary-button:hover {
  background: var(--cobalt-strong, #a6b6f7);
  transform: translateY(-1px);
}

.yam-alert-overlay .ghost-button,
.link-banner .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--line-strong, #465267);
  border-radius: 10px;
  background: transparent;
  color: var(--text, #f1f4f9);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

.yam-alert-overlay .ghost-button:hover,
.link-banner .ghost-button:hover {
  background: var(--surface-hover, #202836);
}

.yam-alert-overlay .status-line {
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #303a4a);
  background: var(--surface, #171d28);
  color: var(--muted, #abb5c4);
  font-size: 0.85rem;
}

.yam-alert-overlay .status-line.is-error,
.yam-alert-overlay .status-line.is-warn {
  border-color: color-mix(in srgb, var(--risk, #e07886) 40%, var(--line, #303a4a));
  color: var(--risk, #e07886);
}

/* --- Telegram link banner --- */

.link-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--cobalt, #8299ef) 35%, var(--line, #303a4a));
  border-radius: 14px;
  background: color-mix(in srgb, var(--cobalt, #8299ef) 7%, var(--surface, #171d28));
}

.link-banner h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.link-banner p {
  margin: 0;
  color: var(--muted, #abb5c4);
  font-size: 0.89rem;
  line-height: 1.55;
}

.link-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-banner-extra:empty {
  display: none;
}

.link-banner-extra {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-code {
  align-self: flex-start;
  padding: 10px 18px;
  border: 1px dashed var(--line-strong, #465267);
  border-radius: 10px;
  background: var(--ledger, #10151e);
  font-family: var(--font-mono, monospace);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  user-select: all;
}

.link-code-help {
  margin: 0;
  color: var(--muted, #abb5c4);
  font-size: 0.85rem;
  line-height: 1.5;
}
