﻿/* Shared components */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rh { position: relative; overflow: hidden; }
.rp {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  pointer-events: none;
  transform: scale(0);
  animation: rpAnim .55s ease-out forwards;
}
@keyframes rpAnim { to { transform: scale(4); opacity: 0; } }

#toastRoot {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 220px;
  max-width: 340px;
  padding: 10px 15px;
  background: var(--onyx);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--tx);
  font-size: 12.5px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .55);
  pointer-events: all;
  animation: toastIn .3s cubic-bezier(.34, 1.56, .64, 1) forwards;
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast-ic {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-ic.ok { background: rgba(34, 197, 94, .15); }
.toast-ic.ok svg { stroke: #22C55E; }
.toast-ic.inf { background: rgba(99, 102, 241, .15); }
.toast-ic.inf svg { stroke: #818CF8; }
.toast-ic.err { background: rgba(232,0,28, .15); }
.toast-ic.err svg { stroke: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px) scale(.94); } }

.m-dd {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 9000;
  display: none;
  min-width: 240px;
  max-width: 280px;
  background: var(--onyx);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 -10px 32px rgba(0, 0, 0, .7);
}
.m-dd.open { display: flex; flex-direction: column; animation: popUp .18s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes popUp { from { opacity: 0; transform: translateY(7px) scale(.96); } to { opacity: 1; transform: none; } }
.dd-search-wrap { padding: 8px 10px 6px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dd-search {
  width: 100%;
  padding: 6px 10px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--tx);
  font-size: 12px;
  outline: none;
}
.dd-search:focus { border-color: var(--dim); }
.dd-list { max-height: 280px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.dd-hdr {
  padding: 8px 13px 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--dim);
  text-transform: uppercase;
}
.dd-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  color: var(--tx);
  cursor: pointer;
  overflow: hidden;
  transition: background .1s, transform .12s;
}
.dd-opt:hover { background: var(--s2); transform: translateX(2px); }
.dd-opt.sel { background: var(--red-dim); }
.dd-opt.hidden { display: none; }
.dd-ico {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--s2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.dd-opt:hover .dd-ico { transform: scale(1.12); }
.dd-info { flex: 1; min-width: 0; }
.dd-nm, .dd-sb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-nm { font-size: 12.5px; font-weight: 600; }
.dd-sb { font-size: 11px; color: var(--muted); }
.dd-chk { flex-shrink: 0; color: var(--red); font-size: 12px; }
.dd-sep { height: 1px; margin: 3px 0; background: var(--border); }
.dd-empty { padding: 14px 13px; font-size: 12px; color: var(--dim); text-align: center; }

.ov {
  position: fixed;
  inset: 0;
  z-index: 7200;
  display: none;
  background: rgba(3, 3, 3, .18);
  backdrop-filter: none;
}
.ov.on { display: block; }
.ov[data-mode="floating"] {
  background: rgba(3, 3, 3, .12);
}
.ov[data-mode="sidebar"] {
  background: rgba(3, 3, 3, .18);
}

.history-modal {
  position: fixed;
  inset: 0;
  z-index: 7600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.history-modal.show { display: flex; }
.history-modal-card {
  position: relative;
  width: min(100%, 420px);
  padding: 28px 24px 22px;
  background: var(--onyx);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .5);
}
.history-modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,0,28, .48), transparent);
}
.history-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .15s, background .15s, transform .15s;
}
.history-modal-close:hover { color: var(--tx); background: var(--s2); transform: rotate(90deg); }
.history-modal-eyebrow {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--red);
  text-transform: uppercase;
}
.history-modal-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
}
.history-modal-copy {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.history-modal-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 18px;
}
.history-modal-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
}
.history-modal-input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--s1);
  color: var(--tx);
}
.history-modal-input:focus { border-color: rgba(232,0,28, .45); }
.history-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.history-modal-btn {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform .14s, background .14s, border-color .14s, color .14s, box-shadow .14s;
}
.history-modal-btn:hover { transform: translateY(-1px); }
.history-modal-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.history-modal-btn-ghost:hover { color: var(--tx); background: var(--s2); }
.history-modal-btn-primary {
  background: var(--red);
  color: #fff;
}
.history-modal-btn-primary:hover { filter: brightness(1.12); box-shadow: 0 10px 24px rgba(232,0,28,.35); }
.history-modal-btn-danger {
  background: rgba(232,0,28, .12);
  color: #fff;
  border: 1px solid rgba(232,0,28, .28);
}
.history-modal-btn-danger:hover { background: rgba(232,0,28, .18); border-color: rgba(232,0,28, .45); }

@media (max-width: 720px) {
  #toastRoot {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }

  .history-modal {
    align-items: flex-end;
    padding: 12px;
  }

  .history-modal-card {
    width: 100%;
    border-radius: 20px 20px 16px 16px;
  }
}
