/* 가격 알림: 만들기 창 · 오른쪽 패널 목록 · 울림 카드 */

/* ---------- 만들기 창 ---------- */
.al-dlg { width: min(460px, calc(100vw - 24px)); max-height: 86vh; }
.al-body { padding: 4px 16px 8px; }
.al-sec { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.al-sec:last-child { border-bottom: 0; }
.al-lab { font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); }
.al-cond { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-items: center; } /* 11/02 트레이딩뷰처럼 한 줄씩: 종목 → 대상 → 무엇이 일어나면 → 조건 */
.al-cond .al-sym { grid-column: 1 / -1; } /* 11/02: 대상(가격 · RSI · 지표 선 · 신호 · 그린 선) 이름이 길어 한 줄을 넓게 */
.al-xhint { margin-top: 6px; }
.al-cond .inp, .al-exp .inp, .al-dlg .field input { height: 34px; width: 100%; min-width: 0; font-size: var(--fs); }
.al-cond select.inp { padding: 0 6px; }
.al-sym { font-weight: 700; }
.al-sym[readonly] { color: var(--text-2); }
.al-fixed { font-size: var(--fs-sm); color: var(--text-2); padding: 0 2px; }
.al-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.al-vals .al-v2[hidden] { display: none; }
.al-vals:has(.al-v2[hidden]) { grid-template-columns: 1fr; }
.al-vals input { font-variant-numeric: tabular-nums; }
.al-cur { font-size: var(--fs-xs); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.al-cur b { color: var(--text); font-variant-numeric: tabular-nums; }
.al-link { color: var(--brand-2); font-size: var(--fs-xs); padding: 0; background: none; border: 0; cursor: pointer; }
.al-link:hover { text-decoration: underline; }
.al-trig button { padding: 6px 4px; }
.al-hint { font-size: var(--fs-xs); line-height: 1.5; }
.al-exp { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.al-exp .inp:disabled { opacity: .45; }
.al-exp input[type="datetime-local"] { color-scheme: dark; }
:root[data-theme="light"] .al-exp input[type="datetime-local"] { color-scheme: light; }
.al-msg { width: 100%; min-height: 54px; height: auto; padding: 8px 10px; resize: vertical; font: inherit; font-size: var(--fs-sm); line-height: 1.5; }
.al-notify { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.al-chk { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text); cursor: pointer; white-space: nowrap; }
.al-chk input { width: 15px; height: 15px; accent-color: var(--brand); margin: 0; }
.al-chk input:disabled + span { opacity: .5; }
.al-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.al-foot .sp { flex: 1; }
.al-foot .btn { height: 32px; padding: 0 14px; }
.al-note { font-size: var(--fs-xs); }

/* ---------- 오른쪽 패널 ---------- */
.al-panel-head { gap: 8px; }
.al-new { justify-content: center; height: 32px; }
.al-tabs { display: flex; align-items: center; gap: 6px; }
.al-tabs .sp { flex: 1; }
.al-cnt { font-size: 11px; color: var(--text-3); margin-left: 3px; font-variant-numeric: tabular-nums; }
.al-clear { color: var(--text-3); }
.al-clear:hover { color: var(--down); }
.al-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 8px 9px 12px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.al-item:hover { background: var(--hover); }
.al-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--up); }
.st-paused .al-dot { background: var(--text-3); }
.st-fired .al-dot, .al-dot.fired { background: var(--warn); }
.st-expired .al-dot { background: var(--line-2); }
.al-main { flex: 1; min-width: 0; display: grid; gap: 2px; cursor: pointer; }
.al-l1 { display: flex; align-items: center; gap: 6px; }
.al-l2 { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.al-l3 { font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-time { font-size: var(--fs-xs); margin-left: auto; }
.al-ex { font-size: var(--fs-xs); white-space: nowrap; }
.al-st { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 3px; background: var(--up-bg); color: var(--up); }
.st-paused .al-st { background: var(--hover); color: var(--text-3); }
.st-fired .al-st { background: rgba(240, 185, 11, .14); color: var(--warn); }
.st-expired .al-st { background: var(--hover); color: var(--text-3); }
.st-paused .al-l2, .st-expired .al-l2 { color: var(--text-3); }
.al-acts { display: flex; gap: 2px; flex: none; opacity: .55; transition: opacity .12s; }
.al-item:hover .al-acts, .al-acts:focus-within { opacity: 1; }
.al-acts .tool { width: 26px; height: 26px; }
.al-acts .tool .ico { width: 14px; height: 14px; }
.al-acts [data-act="del"]:hover { color: var(--down); }
#alertList .empty .ico { display: block; margin: 0 auto 10px; }
.al-log-msg { max-width: 320px; overflow: hidden; text-overflow: ellipsis; text-align: left !important; }

/* ---------- 울림 카드 ---------- */
.al-toasts { position: fixed; top: calc(var(--topbar-h) + 10px); right: 16px; z-index: 96; display: grid; gap: 8px; width: min(320px, calc(100vw - 32px)); pointer-events: none; }
.al-card { pointer-events: auto; background: var(--win); border: 1px solid var(--line-2); border-left: 3px solid var(--warn); border-radius: var(--r-lg); box-shadow: var(--shadow); font-size: var(--fs-sm); overflow: hidden; animation: alIn .22s ease-out; }
.al-card.out { opacity: 0; transform: translateX(16px); transition: opacity .18s, transform .18s; }
.al-card-h { display: flex; align-items: center; gap: 6px; padding: 9px 8px 0 12px; }
.al-card-h .ico { width: 15px; height: 15px; color: var(--warn); }
.al-card-h .dim { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.al-card-h .sp { flex: 1; }
.al-x { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; color: var(--text-3); background: none; border: 0; cursor: pointer; }
.al-x:hover { background: var(--hover); color: var(--text); }
.al-x .ico { width: 14px; height: 14px; color: inherit; }
.al-card-b { padding: 6px 12px 10px; display: grid; gap: 4px; }
.al-card-sym { font-size: var(--fs-lg); font-weight: 800; }
.al-card-name { color: var(--text-2); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-card-row { display: flex; justify-content: space-between; gap: 10px; }
.al-card-row span { color: var(--text-3); }
.al-card-row b { font-variant-numeric: tabular-nums; text-align: right; }
.al-card-msg { margin-top: 4px; padding: 7px 9px; background: var(--win-2); border-radius: var(--r); color: var(--text-2); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.al-card-f { display: flex; align-items: center; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.al-card-f .sp { flex: 1; }
@keyframes alIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes alUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  /* 휴대폰: 위 막대를 가리지 않게 아래(하단 탭 막대 위)에 — 새 카드가 맨 아래 */
  .al-toasts { top: auto; bottom: calc(56px + 8px + env(safe-area-inset-bottom)); right: 12px; left: 12px; width: auto; display: flex; flex-direction: column-reverse; }
  .al-card { animation-name: alUp; }
  .al-card.out { transform: translateY(16px); }
  .al-acts { opacity: 1; }
  #alertOv { padding-top: 4vh; }
  .al-dlg { max-height: 90vh; }
}
@media (max-width: 420px) {
  .al-cond { grid-template-columns: minmax(0, 1fr); }
  .al-fixed { display: none; }
  .al-foot .al-note { display: none; }
}
@media (max-width: 640px) { .al-card:nth-child(n+3) { display: none; } .al-card-b { padding-bottom: 8px; } }

/* ---------- 11/02 알림 생성 창: 트레이딩뷰와 같은 배치 (왼쪽 이름표 · 오른쪽 칸, 고르기 칸 · 트리거 · 만료 · 메시지 · 알림) ---------- */
.al-dlg:has(.ad-h) { width: min(500px, calc(100vw - 24px)); max-height: 90vh; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; }
.al-dlg .ad-h { display: flex; align-items: center; gap: 8px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.al-dlg .ad-h h3 { font-size: 19px; font-weight: 700; margin: 0; white-space: nowrap; order: 2; }
.al-dlg .ad-h .ad-sym { order: 1; }
.al-dlg .ad-h .ad-back { order: 0; }
.al-dlg .ad-h .sp { order: 3; flex: 1; }
.al-dlg .ad-h .tool { order: 4; }
.al-dlg .ad-sym { background: transparent; border: 0; color: var(--text); font: inherit; font-size: 19px; font-weight: 700; min-width: 0; max-width: 230px; padding: 2px 4px; border-radius: 6px; field-sizing: content; }
.al-dlg .ad-sym:hover, .al-dlg .ad-sym:focus { background: var(--hover); outline: none; }
.al-dlg .ad-back { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; border: 0; background: none; color: var(--text); cursor: pointer; }
.al-dlg .ad-back:hover { background: var(--hover); }
.al-dlg .ad-body { padding: 16px 20px 10px; overflow-y: auto; flex: 1; }
.al-dlg .ad-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 14px; padding: 0; border-bottom: 0; flex-wrap: nowrap; }
.al-dlg .ad-l { color: var(--text-2); font-size: 15px; padding-top: 9px; }
.al-dlg .ad-r { display: grid; gap: 10px; min-width: 0; }
.al-dlg .ad-cond { display: grid; gap: 10px; }
.al-dlg .ad-and { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); font-weight: 700; border-top: 1px dashed var(--line); padding-top: 10px; }
.al-dlg .ad-x { margin-left: auto; width: 24px; height: 24px; border: 0; background: none; color: var(--text-3); border-radius: 5px; cursor: pointer; display: grid; place-items: center; }
.al-dlg .ad-x:hover { background: var(--hover); color: var(--down); }
.al-dlg .ad-x .ico { width: 14px; height: 14px; }
.al-dlg .ad-dd { display: flex; align-items: center; gap: 8px; width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; text-align: left; min-width: 0; }
.al-dlg .ad-dd:hover { border-color: var(--text-3); }
.al-dlg .ad-dd:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.al-dlg .ad-dd-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-dlg .ad-chev { width: 12px; height: 12px; flex: none; color: var(--text-2); transition: transform .15s; }
.al-dlg .ad-chev.up { transform: rotate(180deg); }
.al-dlg .ad-chev.r { width: 14px; height: 14px; }
.al-dlg .ad-ico { width: 20px; height: 20px; flex: none; color: var(--text); }
.al-dlg .ad-tgt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.al-dlg .ad-tgt:has(> .ad-dd:only-child) { grid-template-columns: 1fr; }
.al-dlg .ad-lbl2 { font-size: var(--fs-sm); color: var(--text-2); padding-left: 2px; }
.al-dlg .ad-num { position: relative; }
.al-dlg .ad-num .inp { width: 100%; height: 42px; border-radius: 8px; padding: 0 30px 0 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.al-dlg .ad-num input[type=number] { padding-right: 8px; }
.al-dlg .ad-spin { position: absolute; right: 4px; top: 4px; bottom: 4px; display: grid; grid-template-rows: 1fr 1fr; width: 22px; }
.al-dlg .ad-spin button { border: 0; background: none; color: var(--text-2); font-size: 9px; line-height: 1; cursor: pointer; border-radius: 4px; padding: 0; }
.al-dlg .ad-spin button:hover { background: var(--hover); color: var(--text); }
.al-dlg .ad-add { justify-self: start; border: 0; background: none; color: var(--brand-2); font: inherit; font-size: 15px; padding: 4px 0; cursor: pointer; }
.al-dlg .ad-add:hover { text-decoration: underline; }
.al-dlg .ad-r:has(.ad-tf) { display: flex; align-items: center; gap: 10px; }
.al-dlg .ad-tf { width: auto; min-width: 180px; }
.al-dlg .ad-tfnow { font-size: var(--fs-sm); color: var(--text-2); }
.al-dlg .ad-div { height: 1px; background: var(--line); margin: 6px 0 16px; }
.al-dlg .ad-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; padding: 8px 0; cursor: pointer; text-align: left; max-width: 100%; justify-self: start; }
.al-dlg .ad-link > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.al-dlg .ad-link:hover { color: var(--brand-2); }
.al-dlg .ad-r > .ad-hint { margin-top: -8px; }
.al-dlg .ad-hint { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }
.al-dlg .ad-r input#adExpIn { height: 38px; border-radius: 8px; color-scheme: dark; }
:root[data-theme="light"] .ad-r input#adExpIn { color-scheme: light; }
.al-dlg .ad-note { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; padding: 4px 0 2px; }
.al-dlg .ad-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.al-dlg .ad-foot .sp { flex: 1; }
.al-dlg .ad-btn1, .al-dlg .ad-btn2 { height: 42px; padding: 0 20px; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; }
.al-dlg .ad-btn2 { background: transparent; border: 1px solid var(--line-2); color: var(--text); }
.al-dlg .ad-btn2:hover { background: var(--hover); }
.al-dlg .ad-btn1 { background: var(--text); color: var(--bg); border: 1px solid var(--text); } /* 트레이딩뷰: 어두운 테마에선 흰 단추 */
.al-dlg .ad-btn1:hover { opacity: .88; }
.al-dlg .ad-field { display: grid; gap: 6px; margin-bottom: 14px; font-size: var(--fs-sm); color: var(--text-2); }
.al-dlg .ad-field .inp { height: 40px; border-radius: 8px; font-size: 15px; }
.al-dlg .ad-msg { height: auto !important; min-height: 110px; padding: 10px 12px; resize: vertical; font: inherit; font-size: 15px; line-height: 1.5; }
.al-dlg .ad-nt { display: grid; gap: 6px; }
.al-dlg .ad-ck { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; cursor: pointer; border-bottom: 1px solid var(--line); }
.al-dlg .ad-ck input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.al-dlg .ad-ck span { display: grid; gap: 2px; font-size: 15px; }
.al-dlg .ad-ck small { color: var(--text-3); font-size: var(--fs-xs); }
.al-dlg .ad-ck input:disabled + span { opacity: .5; }
.al-dlg .ad-hook { height: 40px; border-radius: 8px; margin: 2px 0 6px 30px; width: calc(100% - 30px); }
.al-dlg .ad-snd { display: flex; gap: 8px; margin: 2px 0 6px 30px; }
.al-dlg .ad-snd .inp { height: 38px; border-radius: 8px; flex: 1; }
.al-dlg .ad-snd[hidden], .al-dlg .ad-hook[hidden] { display: none; }
/* 고르기 목록 (트레이딩뷰처럼 아이콘 · 묶음 제목 · 더 보기) */
.ad-menu { position: fixed; z-index: 10050; background: var(--tv-menu, var(--win)); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); padding: 6px; overflow-y: auto; min-width: 200px; max-width: min(440px, calc(100vw - 16px)); }
.ad-it { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 10px; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; border-radius: 7px; }
.ad-it.sub { padding-left: 22px; }
.ad-it small { margin-left: auto; color: var(--text-2); font-size: var(--fs-sm); }
.ad-it:hover, .ad-it:focus-visible { background: var(--hover); outline: none; }
.ad-it.on { background: var(--text); color: var(--bg); font-weight: 700; }
.ad-it.on .ad-ico, .ad-it.on small { color: var(--bg); }
.ad-head { font-size: var(--fs-xs); color: var(--text-3); padding: 10px 10px 4px; font-weight: 700; }
.ad-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.ad-more { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: var(--fs-xs); cursor: pointer; border-top: 1px solid var(--line); margin-top: 4px; }
@media (max-width: 560px) {
  .al-dlg .ad-row { grid-template-columns: 1fr; gap: 6px; }
  .al-dlg .ad-l { padding-top: 0; font-size: var(--fs-sm); }
  .al-dlg .ad-h h3, .al-dlg .ad-sym { font-size: 17px; }
  .al-dlg .ad-body { padding: 12px 14px 8px; }
  .al-dlg .ad-foot { padding: 12px 14px; }
}
.ad-menu .ad-ico { width: 20px; height: 20px; flex: none; color: inherit; }
.ad-menu .ad-chev { width: 12px; height: 12px; flex: none; transition: transform .15s; }
.ad-menu .ad-chev.up { transform: rotate(180deg); }
