/* Kingdom Watchlist & Transfers - one shared stylesheet for both front-ends ([kingdom_watchlist] and [kingdom_transfers]).
   Everything (toolbar, buttons, forms, tables, tooltip, history, phone cards) uses the same rules, so both pages look identical.
   Colours, radius, button height and font size come from Watchlist -> Appearance. */
.kwl{--kwl-accent:var(--ast-global-color-0,var(--wp--preset--color--primary,#2563eb));--kwl-bad:#c0392b;--kwl-good:#2e8b57;--kwl-radius:6px;--kwl-h:42px;--kwl-line:rgba(128,128,128,.35);width:100%;box-sizing:border-box;position:relative}
.kwl *{box-sizing:border-box}
.kwl .kwl-title{margin:0 0 12px}
.kwl .kwl-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:0 0 14px}
.kwl .kwl-search{flex:1 1 220px;min-width:0;height:var(--kwl-h);min-height:var(--kwl-h);padding:0 12px;margin:0;border-radius:var(--kwl-radius)}
.kwl .kwl-chips{display:flex;gap:6px;flex-wrap:wrap}
.kwl .kwl-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-left:auto}
.kwl .kwl-who{font-size:.85em;opacity:.75}
.kwl .kwl-btn{display:inline-flex;align-items:center;justify-content:center;height:var(--kwl-h);min-height:var(--kwl-h);padding:0 16px;margin:0;line-height:1;font-size:inherit;cursor:pointer;border:1px solid var(--kwl-accent);background:transparent;color:var(--kwl-accent);border-radius:var(--kwl-radius);box-shadow:none;text-decoration:none}
.kwl .kwl-btn:hover{background:var(--kwl-accent);color:#fff}
.kwl .kwl-btn.kwl-on,.kwl .kwl-btn.kwl-primary{background:var(--kwl-accent);color:#fff}
.kwl .kwl-btn[disabled]{opacity:.45;cursor:default}
.kwl .kwl-btn.kwl-sm{height:32px;min-height:32px;padding:0 12px;font-size:.85em}
.kwl .kwl-btn.kwl-danger{border-color:var(--kwl-bad);color:var(--kwl-bad)}
.kwl .kwl-btn.kwl-danger:hover{background:var(--kwl-bad);color:#fff}
.kwl .kwl-idrow{display:flex;gap:8px;align-items:center}
.kwl .kwl-idrow input{flex:1 1 auto;min-width:0}
.kwl .kwl-hint{font-size:.8em;opacity:.85;margin:4px 0 0;line-height:1.4;overflow-wrap:anywhere}
.kwl .kwl-panel{border:1px solid var(--kwl-line);border-left:4px solid var(--kwl-accent);border-radius:var(--kwl-radius);padding:14px 16px;margin:0 0 16px;max-width:720px}
.kwl .kwl-panel h3{margin:0 0 10px;font-size:1.1em}
.kwl .kwl-login,.kwl .kwl-edit{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px}
.kwl .kwl-field{display:flex;flex-direction:column;min-width:0}
.kwl .kwl-field label{font-size:13px;font-weight:600;line-height:1.3;margin:0 0 4px}
.kwl .kwl-field input,.kwl .kwl-field select{height:var(--kwl-h);min-height:var(--kwl-h);padding:0 12px;margin:0;width:100%;border-radius:var(--kwl-radius)}
.kwl .kwl-field textarea{padding:10px 12px;margin:0;width:100%;border-radius:var(--kwl-radius)}
.kwl .kwl-wide,.kwl .kwl-login .kwl-row,.kwl .kwl-login .kwl-msg,.kwl .kwl-edit .kwl-msg,.kwl .kwl-edit h3{grid-column:1/-1}
.kwl .kwl-row{display:flex;gap:8px;flex-wrap:wrap}
.kwl .kwl-msg{padding:8px 12px;border-radius:var(--kwl-radius);border-left:4px solid var(--kwl-accent);margin:0 0 12px;font-size:.9em}
.kwl .kwl-msg.kwl-err{border-left-color:var(--kwl-bad)}
.kwl .kwl-msg.kwl-ok{border-left-color:var(--kwl-good)}
.kwl .kwl-tablewrap{overflow-x:auto}
.kwl table.kwl-table{width:100%;border-collapse:collapse;margin:0}
.kwl .kwl-table th,.kwl .kwl-table td{text-align:left;vertical-align:top;padding:10px 12px;border:0;border-bottom:1px solid var(--kwl-line)}
.kwl .kwl-table th{border-bottom:2px solid var(--kwl-accent);white-space:nowrap;user-select:none}
.kwl .kwl-table th.kwl-sortable{cursor:pointer}
.kwl .kwl-table tbody tr:nth-child(even) td{background:rgba(128,128,128,.08)}
.kwl .kwl-table tbody tr:hover td{background:rgba(128,128,128,.16)}
.kwl .kwl-c-reason{min-width:200px;word-break:break-word}
.kwl .kwl-tipwrap{cursor:help;border-bottom:1px dotted currentColor;outline:none}
.kwl .kwl-tipwrap:focus{border-bottom-style:solid}
.kwl .kwl-tip{position:fixed;z-index:99999;box-sizing:border-box;width:max-content;max-width:min(340px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:hidden;padding:10px 12px;border-radius:var(--kwl-radius);background:#1f2937;color:#f9fafb;font-size:13px;font-weight:400;line-height:1.45;text-align:left;white-space:normal;overflow-wrap:anywhere;word-break:normal;box-shadow:0 6px 20px rgba(0,0,0,.35);pointer-events:none}
.kwl .kwl-tip div{white-space:normal;overflow-wrap:anywhere}
.kwl .kwl-badge{display:inline-block;padding:2px 10px;border-radius:999px;font-size:.8em;font-weight:600;color:#fff}
.kwl .kwl-badge.kwl-bad{background:var(--kwl-bad)}
.kwl .kwl-badge.kwl-good{background:var(--kwl-good)}
.kwl .kwl-acts{white-space:nowrap}
.kwl .kwl-acts .kwl-btn{margin-right:6px}
.kwl .kwl-pager{display:flex;gap:10px;align-items:center;justify-content:center;margin:14px 0 6px;flex-wrap:wrap}
.kwl .kwl-pageinfo{font-size:.85em;opacity:.8}
.kwl .kwl-removed{font-size:.8em;opacity:.8;margin:10px 0 0;line-height:1.5}
.kwl .kwl-history{margin:22px 0 0}
.kwl .kwl-h-list{margin:12px 0}
.kwl .kwl-h-item{padding:10px 12px;border:1px solid var(--kwl-line);border-left:4px solid var(--kwl-accent);border-radius:var(--kwl-radius);margin:0 0 8px}
.kwl .kwl-h-head{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline}
.kwl .kwl-h-act{display:inline-block;padding:1px 9px;border-radius:999px;font-size:.75em;font-weight:700;color:#fff;background:var(--kwl-accent)}
.kwl .kwl-act-create{background:var(--kwl-good)}
.kwl .kwl-act-delete{background:var(--kwl-bad)}
.kwl .kwl-h-id,.kwl .kwl-h-meta{font-size:.8em;opacity:.75}
.kwl .kwl-h-meta{margin-left:auto}
.kwl .kwl-h-chg{font-size:.85em;margin-top:4px;word-break:break-word;opacity:.9}
/* Transfers: associated players listed under their main player */
@media (min-width:701px){
.kwl.kwt .kwl-table tbody tr.ktf-child td{background:rgba(128,128,128,.12)}
.kwl.kwt .kwl-table tbody tr.ktf-child td:first-child{box-shadow:inset 3px 0 0 var(--kwl-accent,currentColor)}
}
@media (max-width:700px){
.kwl .kwl-toolbar{flex-direction:column;align-items:stretch}
.kwl .kwl-search{flex:none;width:100%}
.kwl .kwl-chips .kwl-btn{flex:1}
.kwl .kwl-actions{margin-left:0}
.kwl .kwl-actions .kwl-btn{flex:1}
.kwl .kwl-login,.kwl .kwl-edit{grid-template-columns:1fr}
.kwl .kwl-h-meta{margin-left:0;width:100%}
.kwl .kwl-tablewrap{overflow:visible}
.kwl .kwl-table,.kwl .kwl-table tbody{display:block}
.kwl .kwl-table thead{display:none}
.kwl .kwl-table tbody tr{display:grid;grid-template-columns:1fr auto;padding:12px 14px;margin:0 0 12px;border:1px solid var(--kwl-line);border-left:4px solid var(--kwl-accent);border-radius:var(--kwl-radius)}
.kwl .kwl-table tbody tr:nth-child(even) td,.kwl .kwl-table tbody tr:hover td{background:transparent}
.kwl .kwl-table tbody td{display:block;padding:0;border:0;min-width:0}
.kwl .kwl-table td.kwl-acts{grid-column:1/-1;grid-row:7;display:flex;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid var(--kwl-line)}
.kwl .kwl-table td.kwl-acts .kwl-btn{flex:1;margin:0}
.kwl .kwl-table tr.kwl-empty{display:block;border-left-width:1px}
/* ---- Phone cards: same scheme on both pages ----
   Row 1: name (left, bold) and Updated (right, small).
   Then two equal columns with no field labels and the same font size: left column left-aligned, right column right-aligned.
   Long text (Reason / Notes) across the full width, then small "who" lines (Watchlist), then the buttons. Empty cells are hidden. */
.kwl .kwl-table tbody tr{grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:12px;align-items:start}
.kwl .kwl-table tbody td{min-width:0;overflow-wrap:anywhere}
.kwl .kwl-table td.ktf-empty{display:none}
.kwl .kwl-table td.kwl-c-name,.kwl .kwl-table td.kwl-c-last_name{grid-column:1;grid-row:1;font-size:1.1em;font-weight:700;padding-right:0}
.kwl .kwl-table td.kwl-c-date_updated{grid-column:2;grid-row:1;margin:0;text-align:right;font-size:.78em;opacity:.75}
.kwl .kwl-table td.kwl-c-player_id,.kwl .kwl-table td.kwl-c-strength,.kwl .kwl-table td.kwl-c-location,.kwl .kwl-table td.kwl-c-kingdom,.kwl .kwl-table td.kwl-c-alliance,.kwl .kwl-table td.kwl-c-dest_alliance,.kwl .kwl-table td.kwl-c-status,.kwl .kwl-table td.kwl-c-added_by_alliance{margin-top:6px;font-size:1em;font-weight:400;opacity:1;white-space:normal}
.kwl .kwl-table td.kwl-c-player_id,.kwl .kwl-table td.kwl-c-strength,.kwl .kwl-table td.kwl-c-location,.kwl .kwl-table td.kwl-c-status{grid-column:1;text-align:left}
.kwl .kwl-table td.kwl-c-kingdom,.kwl .kwl-table td.kwl-c-alliance,.kwl .kwl-table td.kwl-c-dest_alliance,.kwl .kwl-table td.kwl-c-added_by_alliance{grid-column:2;text-align:right}
.kwl .kwl-table td.kwl-c-reason,.kwl .kwl-table td.kwl-c-notes{grid-column:1/-1;grid-row:5;margin-top:10px;padding-top:10px;border-top:1px solid var(--kwl-line);line-height:1.45;min-width:0}
.kwl .kwl-table td.kwl-acts{grid-column:1/-1;grid-row:9;display:flex;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid var(--kwl-line)}
.kwl .kwl-table td.kwl-acts .kwl-btn{flex:1;margin:0}
.kwl .kwl-table tr.kwl-empty{display:block;border-left-width:1px}
/* Watchlist grid positions */
.kwl .kwl-table td.kwl-c-player_id{grid-row:2}
.kwl .kwl-table td.kwl-c-alliance{grid-row:2}
.kwl .kwl-table td.kwl-c-status{grid-row:3}
.kwl .kwl-table td.kwl-c-added_by_alliance{grid-row:3}
.kwl .kwl-table td.kwl-c-added_by,.kwl .kwl-table td.kwl-c-updated_by,.kwl .kwl-table td.kwl-c-date_added{grid-column:1/-1;margin-top:6px;font-size:.78em;opacity:.75}
.kwl .kwl-table td.kwl-c-added_by{grid-row:6}
.kwl .kwl-table td.kwl-c-date_added{display:none}
.kwl .kwl-table td.kwl-c-updated_by{grid-row:8}
.kwl .kwl-table td.kwl-c-added_by::before,.kwl .kwl-table td.kwl-c-updated_by::before,.kwl .kwl-table td.kwl-c-date_added::before{content:attr(data-l) ": ";font-weight:600}
/* Transfers grid positions */
.kwl.kwt .kwl-table td.kwl-c-player_id{grid-row:2}
.kwl.kwt .kwl-table td.kwl-c-strength{grid-row:3}
.kwl.kwt .kwl-table td.kwl-c-location{grid-row:4}
.kwl.kwt .kwl-table td.kwl-c-kingdom{grid-row:2}
.kwl.kwt .kwl-table td.kwl-c-alliance{grid-row:3}
.kwl.kwt .kwl-table td.kwl-c-dest_alliance{grid-row:4}
.kwl.kwt .kwl-table tbody tr.ktf-child{margin-left:14px;background:rgba(128,128,128,.10)}
}
