/* Fiyat alarmı penceresi ve tablo zilleri — style.css'teki kutu (.box/.head), hesaplayıcı (.akc-*),
   seçim listesi (.fsel-*) ve anahtar (.switch) dilini kullanır. */

/* ---------- Pencere ---------- */
.pa-modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 24px 16px; }
.pa-modal[hidden] { display: none; }
.pa-overlay { position: absolute; inset: 0; background: rgba(5, 10, 20, .5); animation: pa-fade .18s ease; }
.pa-panel {
  position: relative; width: min(540px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 20px 20px; border-radius: var(--r); background: var(--surface); box-shadow: 0 24px 60px rgba(5, 10, 20, .35);
  animation: pa-rise .2s ease; scrollbar-width: thin;
}
@keyframes pa-fade { from { opacity: 0; } }
@keyframes pa-rise { from { opacity: 0; transform: translateY(10px); } }
.pa-head { margin-bottom: 4px; }
.pa-x { width: 32px; height: 32px; margin: 0 -6px 6px 0; display: grid; place-items: center; border-radius: 4px; color: var(--muted); font-size: 17px; transition: background .15s, color .15s; }
.pa-x:hover { background: var(--surface-2); color: var(--text); }

.pa-field { margin-top: 14px; }
.pa-hint { min-height: 1.4em; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.pa-hint.is-warn { color: var(--brand); }
.pa-hint b { font-weight: 600; color: var(--text-2); }

/* ---------- Kalem seçici (aranabilir, gruplu) ---------- */
.pa-pick { position: relative; --c: var(--c-ekonomi); }
.pa-pick-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); color: var(--text); text-align: left; transition: border-color .15s;
}
.pa-pick-btn:hover, .pa-pick.is-open .pa-pick-btn { border-color: var(--text-2); }
.pa-pick.is-open .fsel-chev { transform: rotate(180deg); }
.pa-pick-val { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.pa-pick-val b { overflow: hidden; font: 600 15.5px var(--f-head); text-overflow: ellipsis; white-space: nowrap; }
.pa-pick-val small { font-size: 12px; color: var(--muted); }
.pa-pick-now { font: 600 15px var(--f-head); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pa-pop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 14px 32px rgba(18, 24, 38, .18); animation: drop .15s ease;
}
.pa-pop[hidden] { display: none; }
.pa-search { display: flex; align-items: center; gap: 9px; margin: 6px 6px 0; padding: 0 10px; height: 38px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.pa-search i { font-size: 13px; }
.pa-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 14.5px var(--f-body); }
.pa-search input::-webkit-search-cancel-button { cursor: pointer; }
.pa-list { max-height: 300px; overflow-y: auto; padding: 4px 6px 6px; scrollbar-width: thin; }
.pa-list .fsel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; position: sticky; top: -4px; z-index: 1; background: var(--surface); }
.pa-list .fsel-head small { font: 500 11px var(--f-body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.pa-list .fsel-opt { gap: 10px; padding: 7px 10px; }
.pa-list .fsel-opt[aria-selected="true"]::after { display: none; }
.pa-opt-name { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.pa-opt-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-opt-name small { flex: none; font-size: 11.5px; color: var(--muted); }
.pa-opt-val { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.pa-opt-val i { margin-left: 6px; font-size: 11px; }
.pa-opt-val .is-up { color: var(--up); }
.pa-opt-val .is-down { color: var(--down); }
.pa-opt-val .is-flat { visibility: hidden; }
.pa-list .fsel-opt.is-alerted .pa-opt-name::after { content: "\f0f3"; font: 900 10px "Font Awesome 6 Free"; color: var(--c-ekonomi); }
.pa-list-empty { padding: 14px 10px; font-size: 13.5px; color: var(--muted); }
.pa-list .fsel-opt[hidden], .pa-list .fsel-head[hidden], .pa-list .pa-list-empty[hidden] { display: none; }

.pa-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.pa-now b { font: 600 14px var(--f-head); color: var(--text); font-variant-numeric: tabular-nums; }
.pa-now .up { color: var(--up); font-weight: 600; }
.pa-now .down { color: var(--down); font-weight: 600; }
.pa-now .is-sample { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 3px; background: color-mix(in srgb, var(--amber) 22%, var(--surface)); font-size: 12px; font-weight: 500; color: var(--text-2); }

/* ---------- Koşul ve sıklık (hesaplayıcıdaki bölmeli düğme) ---------- */
.pa-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 8px; font-weight: 500; font-size: 13.5px; }
.pa-seg button b { font-weight: 600; }
.pa-seg button em { font-style: normal; }
.pa-seg button.is-active { color: var(--text); }
.pa-conds { row-gap: 3px; }
.pa-conds button { height: 38px; }
.pa-conds button i { font-size: 12px; color: var(--muted); transition: color .15s; }
.pa-conds button.is-active[data-pa-cond="above"] i, .pa-conds button.is-active[data-pa-cond="change_up"] i { color: var(--up); }
.pa-conds button.is-active[data-pa-cond="below"] i, .pa-conds button.is-active[data-pa-cond="change_down"] i { color: var(--down); }
.pa-seg button:focus-visible { outline: 2px solid var(--c-ekonomi); outline-offset: -2px; }

.pa-qty { grid-template-columns: 40px minmax(0, 1fr) auto 40px; height: 44px; }
.pa-qty input { font-size: 18px; }
.pa-qty.is-warn { border-color: var(--brand); }

/* ---------- Bilgi / izin kutusu ---------- */
.pa-notice { display: flex; gap: 10px; margin-top: 16px; padding: 11px 13px; border-radius: 4px; background: var(--surface-2); font-size: 13px; line-height: 1.5; color: var(--text-2); }
.pa-notice[hidden] { display: none; }
.pa-notice > i { margin-top: 2px; color: var(--muted); }
.pa-notice b { font-weight: 600; color: var(--text); }
.pa-notice .pa-nt { display: block; margin-bottom: 2px; font: 600 14px var(--f-head); }
.pa-notice ol { margin: 4px 0 0 18px; list-style: decimal; }
.pa-notice li + li { margin-top: 2px; }
.pa-notice.is-warn { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.pa-notice.is-warn > i { color: var(--brand); }
.pa-notice.is-ok > i { color: var(--up); }
.pa-form .cf-error { margin-top: 14px; }

.pa-submit { width: 100%; height: 44px; margin-top: 16px; background: var(--c-ekonomi); font-size: 15px; }
.pa-submit:hover { background: color-mix(in srgb, var(--c-ekonomi) 86%, #000); }
.pa-submit:disabled { opacity: .65; cursor: progress; }
.pa-privacy { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 9px; font-size: 12px; color: var(--muted); text-align: center; }
.pa-privacy i { font-size: 11px; }

/* ---------- Kurulu alarmlarım ---------- */
.pa-mine { margin-top: 20px; padding-top: 14px; border-top: 2px solid var(--line); }
.pa-mine[hidden] { display: none; }
.pa-mine-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pa-mine-head h3 { font: 700 15px var(--f-head); letter-spacing: .02em; text-transform: uppercase; color: var(--text); }
.pa-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pa-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.pa-item:last-child { border-bottom: 0; }
.pa-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pa-item-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; color: var(--text-2); }
.pa-item-title a { font: 600 14.5px var(--f-head); color: var(--text); }
.pa-item-title a:hover { color: var(--c-ekonomi); }
.pa-item-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pa-item-meta .is-hit { color: var(--up); font-weight: 500; }
.pa-item.is-off .pa-item-title, .pa-item.is-off .pa-item-title a { color: var(--muted); }
.pa-item .switch input:checked + .sw-track { background: var(--c-ekonomi); }
.pa-del { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 4px; color: var(--muted); font-size: 14px; transition: background .15s, color .15s; }
.pa-del:hover { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); color: var(--brand); }
.pa-empty { padding: 8px 0 2px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.pa-empty[hidden] { display: none; }
.pa-off { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 0; font-size: 13px; color: var(--muted); transition: color .15s; }
.pa-off:hover, .pa-off.is-confirm { color: var(--brand); }
.pa-off[hidden] { display: none; }
.pa-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Tablo satırındaki zil ---------- */
.pa-bell {
  width: 26px; height: 26px; margin: -4px -4px -4px 4px; display: inline-grid; place-items: center; vertical-align: middle; border-radius: 50%;
  color: var(--muted); font-size: 12.5px; opacity: .55; transition: opacity .15s, color .15s, background .15s;
}
.ak-table tbody tr:hover .pa-bell, .pa-bell:focus-visible { opacity: 1; }
.pa-bell:hover { background: color-mix(in srgb, var(--c-ekonomi) 10%, var(--surface)); color: var(--c-ekonomi); opacity: 1; }
.pa-bell.is-on { color: var(--c-ekonomi); opacity: 1; }
.coin + .pa-bell { margin-left: 2px; }

@media (max-width: 760px) {
  .pa-modal { place-items: end stretch; padding: 0; }
  .pa-panel { width: 100%; max-height: 92dvh; padding: 12px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 12px 12px 0 0; animation: pa-sheet .22s ease; }
  @keyframes pa-sheet { from { transform: translateY(24px); opacity: 0; } }
  .pa-head h2 { font-size: 17px; }
  .pa-seg button { font-size: 13px; gap: 6px; padding: 0 6px; }
  .pa-conds button i { display: none; }
  .pa-list { max-height: 42dvh; }
  .pa-bell { width: 24px; height: 28px; margin: -6px -6px -6px 2px; opacity: .7; }
}
@media (max-width: 380px) {
  .pa-seg button { font-size: 12.5px; }
  .pa-pick-now { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .pa-overlay, .pa-panel, .pa-pop { animation: none; }
}
