#initiativeRail{gap:10px}#initiativeList{max-height:none;overflow:visible;padding:0;display:flex;flex-direction:column;gap:7px}.initiative-row{display:grid;grid-template-columns:minmax(0,1fr) 42px 16px;gap:5px;align-items:center;border:1px solid #334155;border-radius:10px;background:#090d16;padding:9px 7px}.initiative-row.is-current{border-color:#fbbf24;background:#29200e;box-shadow:inset 3px 0 #fbbf24}.initiative-select{display:flex;gap:7px;align-items:center;text-align:left;min-width:0}.initiative-rank{color:#94a3b8;font-size:11px;min-width:15px;text-align:center}.is-current .initiative-rank{color:#fbbf24}.initiative-person{min-width:0}.initiative-person strong{display:block;font-size:12px;color:#f1f5f9;line-height:1.4;overflow-wrap:anywhere;font-weight:600}.initiative-person small{display:block;font-size:10px;color:#94a3b8;margin-top:3px}.is-current small{color:#fcd34d}.initiative-score{display:flex;flex-direction:column;align-items:center;gap:2px}.initiative-score label{font-size:8px;letter-spacing:.08em;color:#94a3b8}.initiative-score input{width:38px;border:1px solid #475569;border-radius:5px;background:#0f172a;color:#fbbf24;text-align:center;padding:4px 0;font-size:12px}.initiative-remove{color:#64748b;font-size:15px}.initiative-remove:hover{color:#fb7185}.initiative-current{display:none!important}.initiative-next{border:1px solid #78521b;border-radius:8px;padding:7px;background:#33230e;color:#fcd34d;font-size:12px;font-weight:600}.initiative-add{border-top:1px solid #334155;padding-top:10px}.initiative-add summary{cursor:pointer;color:#93c5fd;font-size:12px;padding:4px 0}#quickPlayerForm{margin-top:8px;padding:0;background:none;border:none}#quickPlayerForm>div:first-child{display:none}#quickPlayerForm>div:last-child{display:grid;grid-template-columns:minmax(0,1fr) 46px 30px;gap:5px}#quickPlayerInit{width:46px}.enemy-top-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}.enemy-top-actions>button{white-space:nowrap}@media(max-width:650px){.initiative-row{grid-template-columns:minmax(0,1fr) 34px;gap:4px}.initiative-score input{width:30px}.initiative-remove{grid-column:2}.enemy-top-actions{flex-wrap:wrap;justify-content:flex-end;width:100%}}

.initiative-round{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--ui-text,#e2e8f0);font-size:13px}.initiative-reset{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid var(--ui-line,#334155);border-radius:6px;background:var(--ui-surface,#152033)}.initiative-reset:hover{color:#fcd34d;border-color:#b38a37}

/* A flat tracker: one header, one turn toolbar and aligned combatant rows. */
body #initiativeRail{padding:12px!important;gap:8px!important;background:var(--ui-surface,#111d2e)}
body #initiativeRail .initiative-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 0 10px;border-bottom:1px solid var(--ui-line,#40536d);flex-shrink:0}
body #initiativeRail .initiative-heading h2{font-family:inherit;font-size:16px!important;line-height:1.3;margin:0;font-weight:700;letter-spacing:0;text-transform:none;color:var(--ui-text,#e2e8f0)}
body #initiativeRail .initiative-heading p{font-size:11px;line-height:1.4;color:var(--ui-muted,#b2c1d4);margin:3px 0 0}
body #initiativeRail .initiative-sort,body #initiativeRail .initiative-reset{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;min-width:28px;min-height:28px;padding:0;border:1px solid #40536d;border-radius:6px;background:#18273b;color:#b2c1d4}
body #initiativeRail .initiative-turn-controls{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;flex-shrink:0}
body #initiativeRail .initiative-round{gap:5px;font-size:12px;white-space:nowrap}
body #initiativeRail .initiative-round strong{font-size:12px;font-weight:600}
body #initiativeRail .initiative-next{width:auto;min-width:0;min-height:32px;padding:5px 8px;border:1px solid #8a6a2b;border-radius:6px;background:#3b2d14;color:#ffe5a3;font-size:12px;line-height:1.3;text-align:center;white-space:nowrap}
body #initiativeRail .initiative-list-heading{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:5px;padding:4px 19px 0 9px;flex-shrink:0;color:#b2c1d4;font-size:10px;text-transform:uppercase;letter-spacing:.06em}
body #initiativeRail .initiative-list-heading span:last-child{text-align:center}
body #initiativeRail #initiativeList{gap:5px}
body #initiativeRail .initiative-row{grid-template-columns:minmax(0,1fr) 42px!important;gap:6px;align-items:center;min-height:62px;padding:8px 19px 8px 6px!important;border:1px solid #35465c;border-radius:8px;background:#101a29;box-sizing:border-box}
body #initiativeRail .initiative-row.is-current{background:#302711;border-color:#c39a39;box-shadow:inset 3px 0 #f2c14c}
body #initiativeRail .initiative-select{display:flex;align-items:center;gap:6px;min-width:0;width:100%;height:auto;min-height:0;margin:0;padding:3px 2px!important;border:0!important;border-radius:4px;background:transparent!important;box-shadow:none!important;text-align:left;color:inherit}
body #initiativeRail .initiative-select:hover{background:#ffffff08!important}
body #initiativeRail .initiative-rank{min-width:14px;font-size:11px;line-height:1;color:#b2c1d4}
body #initiativeRail .is-current .initiative-rank{color:#f2c14c}
body #initiativeRail .initiative-person strong{font-size:13px;line-height:1.35;font-weight:600;overflow-wrap:break-word}
body #initiativeRail .initiative-person small{font-size:10px;line-height:1.35;margin-top:3px;color:#b2c1d4}
body #initiativeRail .is-current .initiative-person small{color:#ffe5a3}
body #initiativeRail .initiative-score label{display:none}
body #initiativeRail .initiative-score input{box-sizing:border-box;width:40px;height:30px;margin:0;padding:3px 0;border:1px solid #40536d;border-radius:6px;background:#0b1422;color:#e2e8f0;font-size:13px;font-weight:600;line-height:1.3}
body #initiativeRail .initiative-remove{top:3px;right:3px;width:16px;min-width:16px;height:16px;min-height:16px;font-size:12px;line-height:1;padding:0;border:0!important;background:transparent!important;color:#94a3b8;box-shadow:none}
body #initiativeRail .initiative-remove:hover{color:#fda4af;background:#321c24!important}
body #initiativeRail .initiative-add{padding-top:8px;margin:0;border-top:1px solid #40536d}
body #initiativeRail .initiative-add summary{font-size:12px;line-height:1.4;padding:4px 0}

body #initiativeRail button:disabled{opacity:.45;cursor:default}body #initiativeRail .initiative-row:focus-within{outline:2px solid var(--ui-link,#86d9fa);outline-offset:1px}

/* Long names keep a stable row; the complete name remains in the tooltip and accessible label. */
body #initiativeRail .initiative-person{display:flex;flex-direction:column;min-width:0;flex:1;overflow:hidden}body #initiativeRail .initiative-person strong{display:block;width:100%;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}body #initiativeRail .initiative-row{height:62px;overflow:hidden}body #initiativeRail .initiative-rank{flex:none}

/* Compact roster: full-width names above a small metadata/edit line. */
body #initiativeRail #initiativeList{gap:0}
body #initiativeRail .initiative-row{display:flex!important;flex-direction:column;align-items:stretch;gap:3px;min-height:0;height:auto;padding:7px 5px!important;border:0;border-bottom:1px solid var(--ui-line);border-radius:0;background:transparent;overflow:visible;box-shadow:none}
body #initiativeRail .initiative-row.is-current{background:var(--ui-combat-fill);box-shadow:inset 3px 0 var(--ui-combat);border-color:var(--ui-line)}
body #initiativeRail .initiative-select{display:block;padding:0 3px!important;width:100%;min-height:20px;text-align:left}
body #initiativeRail .initiative-name{display:block;font-size:13px;line-height:1.4;font-weight:600;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;color:var(--ui-text)}
body #initiativeRail .initiative-row-meta{display:flex;align-items:center;gap:6px;padding:0 2px;min-width:0}
body #initiativeRail .initiative-position,body #initiativeRail .initiative-kind{font-size:11px;line-height:1.3;color:var(--ui-muted);white-space:nowrap}
body #initiativeRail .is-current .initiative-position{color:var(--ui-combat);font-weight:700}
body #initiativeRail .initiative-score{display:flex;align-items:center;gap:4px;margin-left:auto;min-width:0}
body #initiativeRail .initiative-score label{display:block;font-size:10px;color:var(--ui-muted)}
body #initiativeRail .initiative-score input{width:32px;height:23px;min-height:23px;font-size:12px;padding:1px!important;border-radius:4px;appearance:textfield;-moz-appearance:textfield}
body #initiativeRail .initiative-score input::-webkit-inner-spin-button,body #initiativeRail .initiative-score input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
body #initiativeRail .initiative-remove{position:static!important;flex:none;width:20px;min-width:20px;height:23px;min-height:23px}
body #initiativeRail .initiative-row:hover:not(.is-current){background:var(--ui-raised)}
body #initiativeRail .initiative-select:focus-visible{outline:2px solid var(--ui-story)!important;outline-offset:2px!important}

body #initiativeRail .initiative-row-meta{min-height:0!important;height:23px}body #initiativeRail .initiative-row-meta button,body #initiativeRail .initiative-row-meta input{min-height:23px!important;height:23px!important}body #initiativeRail .initiative-select{min-height:20px!important}

body #initiativeRail .initiative-row{padding:4px 5px!important;gap:2px}body #initiativeRail .initiative-name{line-height:1.35}body #initiativeRail .initiative-row-meta{height:23px}

/* Shared column headers replace repeated initiative labels. */
body #initiativeRail .initiative-list-heading,body #initiativeRail .initiative-row{display:grid!important;grid-template-columns:22px minmax(0,1fr) 32px 16px!important;column-gap:4px;align-items:center}
body #initiativeRail .initiative-list-heading{padding:4px 3px;font-size:11px;text-transform:none;letter-spacing:0;color:var(--ui-muted)}
body #initiativeRail .initiative-row{padding:5px 3px!important;row-gap:0}
body #initiativeRail .initiative-list-heading>span:first-child,body #initiativeRail .initiative-position{text-align:center}
body #initiativeRail .initiative-list-heading>span:nth-child(3){text-align:center}
body #initiativeRail .initiative-select{padding:0!important;min-width:0}
body #initiativeRail .initiative-score{margin:0}
body #initiativeRail .initiative-kind{display:block;margin-top:2px;font-size:10px}
body #initiativeRail .initiative-score input{width:32px;height:26px!important;min-height:26px!important}
body #initiativeRail .initiative-remove{width:16px;min-width:16px;height:24px!important;min-height:24px!important}

/* Name-first turn list: full-width wrapped identity, compact editing line. */
body #initiativeRail{display:flex;flex-direction:column;overflow:hidden!important;min-height:0}
body #initiativeRail #initiativeList{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;gap:0}
body #initiativeRail .initiative-heading,body #initiativeRail .initiative-turn-controls,body #initiativeRail .initiative-add{flex:none}
body #initiativeRail .initiative-add{margin-top:auto}
body #initiativeRail .initiative-list-heading{display:none!important}
body #initiativeRail .initiative-upcoming{flex:none;font-size:11px;line-height:1.4;color:var(--ui-muted);margin:0;padding-bottom:7px;border-bottom:1px solid var(--ui-line);overflow-wrap:anywhere}
body #initiativeRail .initiative-row{display:flex!important;flex-direction:column;align-items:stretch;gap:3px;padding:6px 7px!important;flex:none;border-radius:0;min-height:0;height:auto}
body #initiativeRail .initiative-row-top{display:flex;align-items:center;gap:5px;min-width:0}
body #initiativeRail .initiative-position{font-size:11px;min-width:12px;color:var(--ui-muted)}
body #initiativeRail .initiative-kind{font-size:10px;line-height:1.3;margin:0}
body #initiativeRail .is-current .initiative-kind{color:var(--ui-combat);font-weight:650}
body #initiativeRail .initiative-score{margin-left:auto;flex:none}
body #initiativeRail .initiative-score input{height:23px!important;min-height:23px!important;width:30px;background:transparent;border-color:transparent;font-size:12px;color:var(--ui-text)}
body #initiativeRail .initiative-score input:hover,body #initiativeRail .initiative-score input:focus{background:var(--ui-input);border-color:var(--ui-combat)}
body #initiativeRail .initiative-select{display:block;width:100%;min-height:20px!important;padding:0!important}
body #initiativeRail .initiative-name{font-size:13px;line-height:1.4;white-space:normal;overflow:visible;overflow-wrap:anywhere}
body #initiativeRail .initiative-remove{opacity:0;pointer-events:none;position:static!important;width:16px;min-width:16px;height:23px!important;min-height:23px!important}
body #initiativeRail .initiative-row:hover .initiative-remove,body #initiativeRail .initiative-row:focus-within .initiative-remove{opacity:1;pointer-events:auto}
@media(hover:none){body #initiativeRail .initiative-remove{opacity:1;pointer-events:auto}}

/* Visual polish only: keep the name-first roster and all existing controls. */
body #initiativeRail .initiative-heading{border-bottom:0;padding-bottom:4px}
body #initiativeRail .initiative-heading h2{font-size:15px!important;letter-spacing:.01em}
body #initiativeRail .initiative-heading p{color:var(--ui-muted);margin-top:4px}
body #initiativeRail .initiative-turn-controls{padding:7px;border:1px solid #3e5068;border-radius:7px;background:var(--ui-input);gap:6px}
body #initiativeRail .initiative-round strong{font-size:11px;color:var(--ui-muted)}
body #initiativeRail .initiative-next{border-color:#92743e;background:var(--ui-combat-fill);color:#f4d79f;border-radius:5px}
body #initiativeRail .initiative-next:hover{background:#554326;border-color:var(--ui-combat)}
body #initiativeRail .initiative-upcoming{padding:2px 2px 9px;font-size:11px;line-height:1.45;color:#c0cee0}
body #initiativeRail #initiativeList{gap:4px;padding:1px 2px 4px}
body #initiativeRail .initiative-row{border:1px solid transparent;border-bottom-color:#2d4057;border-radius:6px;background:#142235;padding:7px 8px!important;transition:background .12s,border-color .12s}
body #initiativeRail .initiative-row:nth-child(even):not(.is-current){background:#101c2c}
body #initiativeRail .initiative-row:hover:not(.is-current){background:#1d3048;border-color:#58738f}
body #initiativeRail .initiative-row.is-current{background:linear-gradient(100deg,#3c301b,#242619);border-color:#8d7547;box-shadow:inset 3px 0 var(--ui-combat)}
body #initiativeRail .initiative-row-top{gap:6px}
body #initiativeRail .initiative-position{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;background:#22344b;border-radius:4px;font-size:10px;color:#bdcde1;font-variant-numeric:tabular-nums}
body #initiativeRail .is-current .initiative-position{background:var(--ui-combat);color:#211b11;font-weight:750}
body #initiativeRail .initiative-kind{font-size:10px;letter-spacing:.02em;color:#a9bdd4}
body #initiativeRail .initiative-score input{background:#0d1827;border:1px solid #364d67;border-radius:5px;font-weight:700;color:#d8e7f8}
body #initiativeRail .is-current .initiative-score input{background:#2b2417;border-color:#8d7547;color:#f4d79f}
body #initiativeRail .initiative-name{font-weight:600;color:#e7effa;line-height:1.45}
body #initiativeRail .is-current .initiative-name{color:#fff2d5}
body #initiativeRail .initiative-add{border-top-color:#3e5068;padding-top:8px}
body #initiativeRail .initiative-add summary{color:#b9d2ee;border:1px dashed #405973;border-radius:5px;padding:6px 8px;background:#101c2c}
body #initiativeRail .initiative-add summary:hover{border-color:#91b5d9;background:#1b2b40}
@media(prefers-reduced-motion:reduce){body #initiativeRail .initiative-row{transition:none}}

/* Soft corners retain the compact name-first layout. */
body #initiativeRail{border-radius:14px}
body #initiativeRail .initiative-row{border-radius:11px}
body #initiativeRail .initiative-turn-controls{border-radius:11px}
body #initiativeRail .initiative-next,body #initiativeRail .initiative-sort,body #initiativeRail .initiative-reset{border-radius:8px}
body #initiativeRail .initiative-score input{border-radius:7px}
body #initiativeRail .initiative-position{border-radius:6px}
body #initiativeRail .initiative-add summary{border-radius:9px}
