/* Tickets on EventMe (tickets-plus.js): buying, the ticket types editor and Manage event */

/* ── buying ── */
#evTicketActions { display: grid; gap: 12px; }
.tkx-types { display: grid; gap: 8px; }
.tkx-type { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border, rgba(255,255,255,.1)); background: rgba(255,255,255,.025); transition: border-color .15s, background .15s; }
.tkx-type.is-on { border-color: rgba(200,16,46,.55); background: rgba(200,16,46,.07); }
.tkx-type.is-off { opacity: .62; }
.tkx-type-main { min-width: 0; }
.tkx-type-main b { display: block; font-size: 15px; line-height: 1.3; color: var(--text-1, #fff); overflow-wrap: anywhere; }
.tkx-type-main small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--muted, #9a9a9a); }
.tkx-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tkx-chips:empty { display: none; }
.tkx-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.5; color: var(--text-2, #ddd); background: rgba(255,255,255,.07); }
.tkx-chip.hot { color: #fbbf24; background: rgba(251,191,36,.12); }
.tkx-chip.soon { color: #60a5fa; background: rgba(96,165,250,.12); }
.tkx-chip.off { color: var(--muted, #999); }
.tkx-type-price { text-align: right; white-space: nowrap; }
.tkx-type-price b { display: block; font-size: 16px; color: var(--text-1, #fff); }
.tkx-type-price s { display: block; font-size: 12px; color: var(--muted, #999); }
.tkx-type-price small { display: block; font-size: 11.5px; color: var(--muted, #999); }
.tkx-step { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--border, rgba(255,255,255,.12)); background: rgba(0,0,0,.18); }
.tkx-step button { width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: transparent; color: var(--text-1, #fff); cursor: pointer; }
.tkx-step button:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.tkx-step button:disabled { opacity: .3; cursor: default; }
.tkx-step output { min-width: 22px; text-align: center; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.tkx-owned { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-radius: 12px; background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #4ade80; font-size: 14px; }
.tkx-owned span { color: var(--text-1, #fff); flex: 1 1 auto; }
.tkx-link { border: 0; background: none; padding: 0; color: var(--red-bright, #ff5470); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tkx-promo { font-size: 14px; color: var(--text-2, #ddd); }
.tkx-promo summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted, #aaa); font-weight: 600; list-style: none; }
.tkx-promo summary::-webkit-details-marker { display: none; }
.tkx-promo summary:hover { color: var(--text-1, #fff); }
.tkx-promo-row { display: flex; gap: 8px; margin-top: 8px; }
.tkx-promo-row input { flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border, rgba(255,255,255,.14)); background: var(--field, rgba(255,255,255,.04)); color: var(--text-1, #fff); font: inherit; text-transform: uppercase; letter-spacing: .04em; }
.tkx-promo-row button { flex: none; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border, rgba(255,255,255,.14)); background: transparent; color: var(--text-1, #fff); font: inherit; font-weight: 700; cursor: pointer; }
.tkx-promo.on { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: rgba(34,197,94,.1); border: 1px dashed rgba(34,197,94,.45); color: #4ade80; }
.tkx-promo.on span { flex: 1; color: var(--text-1, #fff); }
.tkx-err { margin: 6px 0 0; color: #f87171; font-size: 13px; }
#evTicketActions .ticket-buy-btn { width: 100%; min-height: 50px; white-space: normal; line-height: 1.25; }
.tkx-spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: tkxSpin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes tkxSpin { to { transform: rotate(360deg); } }
.tkx-loading { display: grid; gap: 8px; }
.tkx-loading span { height: 58px; border-radius: 14px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: tkxShim 1.2s infinite; }
@keyframes tkxShim { to { background-position: -200% 0; } }
@media (max-width: 420px) {
  .tkx-type { grid-template-columns: minmax(0, 1fr) auto; }
  .tkx-type .tkx-step { grid-column: 1 / -1; justify-self: end; }
}

/* ── owner bar on the event window ── */
.tkx-owner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0; padding: 10px 12px; border-radius: 14px; border: 1px dashed rgba(200,16,46,.45); background: rgba(200,16,46,.06); }
.tkx-owner > span { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 auto; font-size: 13px; font-weight: 700; color: var(--text-2, #ddd); }
.tkx-owner button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--red, #c8102e); background: var(--red, #c8102e); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.tkx-owner button + button { background: transparent; border-color: var(--border, rgba(255,255,255,.18)); color: var(--text-1, #fff); }
.tkx-sub-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tkx-sub-btns button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border, rgba(255,255,255,.16)); background: transparent; color: var(--text-1, #fff); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.tkx-sub-btns button:first-child { border-color: rgba(200,16,46,.6); }
.tkx-sub-btns button:hover { border-color: var(--red, #c8102e); }

/* ── modal ── */
.tkx-ov { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(3,2,3,.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: tkxIn .16s ease; }
@keyframes tkxIn { from { opacity: 0; } to { opacity: 1; } }
.tkx-modal { width: min(460px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; border-radius: 20px; background: var(--card, #1d1b1f); border: 1px solid var(--border, rgba(255,255,255,.1)); box-shadow: 0 30px 80px rgba(0,0,0,.5); overflow: hidden; }
.tkx-modal.wide { width: min(760px, 100%); height: min(820px, calc(100dvh - 40px)); }
.tkx-mhead { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--border, rgba(255,255,255,.1)); }
.tkx-mhead h3 { flex: 1; margin: 0; font-size: 18px; font-weight: 800; }
.tkx-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border, rgba(255,255,255,.14)); background: transparent; color: var(--text-1, #fff); display: grid; place-items: center; cursor: pointer; }
.tkx-mbody { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 22px; display: grid; align-content: start; gap: 12px; }
.tkx-pass { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border, rgba(255,255,255,.12)); background: rgba(255,255,255,.03); color: var(--text-1, #fff); font: inherit; text-align: left; cursor: pointer; }
.tkx-pass:hover { border-color: var(--red, #c8102e); }
.tkx-pass span { flex: 1; min-width: 0; }
.tkx-pass b { display: block; font-size: 15px; }
.tkx-pass small { display: block; font-size: 13px; color: var(--muted, #999); }
.tkx-pass em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--red-bright, #ff5470); }
.tkx-hint { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted, #9a9a9a); }
.tkx-hint.top { font-size: 14px; color: var(--text-2, #ccc); }
.tkx-man-ev b { display: block; font-size: 16px; }
.tkx-man-ev small { color: var(--muted, #999); font-size: 13px; }
.tkx-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -2px; }
.tkx-tabs::-webkit-scrollbar { display: none; }
.tkx-tabs button { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border, rgba(255,255,255,.14)); background: transparent; color: var(--text-2, #ccc); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tkx-tabs button[aria-selected="true"] { border-color: var(--red, #c8102e); background: rgba(200,16,46,.12); color: var(--text-1, #fff); }
.tkx-man-body { display: grid; gap: 14px; }
.tkx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tkx-stats div { padding: 12px; border-radius: 12px; border: 1px solid var(--border, rgba(255,255,255,.1)); text-align: center; }
.tkx-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tkx-stats span { font-size: 12px; color: var(--muted, #999); }
.tkx-f { display: grid; gap: 5px; min-width: 0; }
.tkx-f > span { font-size: 13px; font-weight: 700; color: var(--text-2, #ccc); }
.tkx-f input, .tkx-f select, .tkx-f textarea, .tkx-inline select { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border, rgba(255,255,255,.14)); background: var(--field, rgba(255,255,255,.04)); color: var(--text-1, #fff); font: inherit; font-size: 15px; box-sizing: border-box; }
.tkx-f textarea { resize: vertical; line-height: 1.5; }
.tkx-f input:focus, .tkx-f textarea:focus, .tkx-f select:focus { outline: none; border-color: var(--red-bright, #ff5470); box-shadow: 0 0 0 3px rgba(255,84,112,.15); }
.tkx-inline { display: flex; gap: 6px; }
.tkx-inline input { flex: 1; min-width: 0; }
.tkx-inline select { width: auto; flex: none; }
.tkx-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.tkx-status { flex: 1 1 auto; font-size: 13px; color: var(--muted, #999); }
.tkx-status.ok { color: #4ade80; }
.tkx-status.bad { color: #f87171; }
.tkx-primary, .tkx-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--red, #c8102e); background: var(--red, #c8102e); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.tkx-secondary { background: transparent; color: var(--text-1, #fff); border-color: var(--border, rgba(255,255,255,.18)); }
.tkx-primary:disabled { opacity: .6; cursor: default; }
.tkx-icon-btn { width: 38px; height: 38px; flex: none; border-radius: 10px; border: 1px solid var(--border, rgba(255,255,255,.14)); background: transparent; color: var(--text-1, #fff); display: grid; place-items: center; cursor: pointer; }
.tkx-icon-btn:hover { border-color: var(--red, #c8102e); }
.tkx-promos { display: grid; gap: 8px; }
.tkx-promo-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--border, rgba(255,255,255,.2)); }
.tkx-promo-item > div { flex: 1; min-width: 0; }
.tkx-promo-item b { display: block; font-family: ui-monospace, monospace; font-size: 15px; letter-spacing: .05em; }
.tkx-promo-item small { color: var(--muted, #999); font-size: 12.5px; }
.tkx-promo-new { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--border, rgba(255,255,255,.1)); background: rgba(255,255,255,.02); }
.tkx-promo-new h4, .tkx-h4 { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #999); }
.tkx-empty { margin: 0; color: var(--muted, #999); font-size: 14px; }
.tkx-aud { display: grid; gap: 6px; }
.tkx-aud label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border, rgba(255,255,255,.12)); cursor: pointer; }
.tkx-aud label:has(input:checked) { border-color: var(--red, #c8102e); background: rgba(200,16,46,.08); }
.tkx-aud input { accent-color: var(--red, #c8102e); width: 18px; height: 18px; flex: none; }
.tkx-aud b { display: block; font-size: 14px; }
.tkx-aud small { font-size: 12.5px; color: var(--muted, #999); }
.tkx-sent { display: grid; gap: 8px; }
.tkx-sent > div { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border, rgba(255,255,255,.08)); }
.tkx-sent b { display: block; font-size: 14px; }
.tkx-sent small { font-size: 12px; color: var(--muted, #999); }
.tkx-sent p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text-2, #ccc); white-space: pre-wrap; overflow-wrap: anywhere; }
.tkx-linkbox { display: flex; gap: 8px; }
.tkx-linkbox input { flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border, rgba(255,255,255,.14)); background: rgba(0,0,0,.2); color: var(--text-2, #ccc); font: inherit; font-size: 14px; }
.tkx-linkbox button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border, rgba(255,255,255,.18)); background: transparent; color: var(--text-1, #fff); font: inherit; font-weight: 700; cursor: pointer; }
.tkx-copy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 14px; border: 1px solid var(--border, rgba(255,255,255,.1)); }
.tkx-copy > div { flex: 1 1 220px; }
.tkx-copy b { display: block; font-size: 15px; }
.tkx-copy small { font-size: 13px; color: var(--muted, #999); line-height: 1.45; }
@media (max-width: 600px) {
  .tkx-ov { padding: 0; align-items: flex-end; }
  .tkx-modal, .tkx-modal.wide { width: 100%; max-height: 94dvh; height: auto; border-radius: 20px 20px 0 0; }
  .tkx-modal.wide { height: 94dvh; }
  .tkx-mbody { padding: 16px 16px max(20px, env(safe-area-inset-bottom)); }
  .tkx-stats b { font-size: 16px; }
  .tkx-actions > button { flex: 1 1 100%; }
}

/* ── ticket types editor ── */
.tkx-ed { display: grid; gap: 10px; }
.tkx-ed-rows { display: grid; gap: 10px; }
.tkx-ed-row { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--border, rgba(255,255,255,.12)); background: rgba(255,255,255,.02); }
.tkx-ed-top { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(90px, 130px) auto; align-items: end; gap: 8px; }
.tkx-ed-n { width: 26px; height: 26px; margin-bottom: 8px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: rgba(200,16,46,.16); color: var(--red-bright, #ff5470); }
.tkx-ed-del { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border, rgba(255,255,255,.14)); background: transparent; color: var(--muted, #aaa); display: grid; place-items: center; cursor: pointer; }
.tkx-ed-del:hover:not(:disabled) { color: #f87171; border-color: rgba(248,113,113,.5); }
.tkx-ed-del:disabled { opacity: .35; cursor: not-allowed; }
.tkx-ed-more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted, #aaa); padding: 2px 0; }
.tkx-ed-more summary:hover { color: var(--text-1, #fff); }
.tkx-ed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 8px; }
.tkx-ed-grid .wide { grid-column: 1 / -1; }
.tkx-ed-sold { margin: 0; font-size: 12.5px; font-weight: 700; color: #4ade80; }
.tkx-ed-add { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px dashed rgba(200,16,46,.6); background: transparent; color: var(--text-1, #fff); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.tkx-ed-add:hover { background: rgba(200,16,46,.08); }
.tkx-ed-field { grid-column: 1 / -1; }
.tkx-private { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin: 4px 0; border-radius: 12px; border: 1px solid var(--border, rgba(255,255,255,.12)); cursor: pointer; }
.tkx-private input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--red, #c8102e); }
.tkx-private span { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; }
.tkx-private b { font-size: 14px; }
.tkx-private small { grid-column: 1 / -1; font-size: 13px; color: var(--muted, #999); line-height: 1.45; margin-top: 2px; }
.tkx-private:has(input:checked) { border-color: var(--red, #c8102e); background: rgba(200,16,46,.06); }
@media (max-width: 520px) {
  .tkx-ed-top { grid-template-columns: auto minmax(0, 1fr) auto; }
  .tkx-ed-top .tkx-f.price { grid-column: 2 / 3; }
  .tkx-ed-top .tkx-ed-del { grid-row: 1; grid-column: 3; }
}
[data-theme="light"] .tkx-modal { background: #fff; }
[data-theme="light"] .tkx-step, [data-theme="light"] .tkx-linkbox input { background: rgba(0,0,0,.04); }
[data-theme="light"] .tkx-owned span, [data-theme="light"] .tkx-promo.on span { color: #1a1a1a; }
@media (max-width: 480px) {
  .tkx-owner > span { flex-basis: 100%; }
  .tkx-owner button { flex: 1 1 auto; justify-content: center; }
  .tkx-owner button + button { flex: 0 0 auto; }
}

/* layout safety: rows never squash (the tab row could collapse to a line) and nothing spills sideways */
.tkx-mbody { grid-auto-rows: max-content; grid-template-columns: minmax(0, 1fr); }
.tkx-mbody > * { min-width: 0; }
.tkx-tabs { min-height: 42px; flex: none; }
.tkx-modal input, .tkx-modal select, .tkx-modal textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
.tkx-ed-grid > *, .tkx-ed-top > * { min-width: 0; }
.tkx-ed-grid input { width: 100%; }
.tkx-modal [class*="row"] > input { flex: 1 1 auto; }
.tkx-linkbox { display: flex; gap: 8px; min-width: 0; }
.tkx-linkbox input { flex: 1 1 auto; width: auto; }
.tkx-linkbox button { flex: none; white-space: nowrap; }
@media (max-width: 380px) { .tkx-linkbox { flex-wrap: wrap; } .tkx-linkbox button { flex: 1 1 100%; justify-content: center; } }
