/* v1.4 — character identity and visible lookup feedback */
.roster,.roster.auto-directions{min-width:770px}
.roster .col-no{width:28px}.roster .col-name{width:120px}.roster .col-world{width:112px}.roster .col-job,.roster.auto-directions .col-job{width:84px}.roster .col-power,.roster.auto-directions .col-power{width:136px}.roster .col-clock{width:104px}.roster.auto-directions .col-clock{width:166px}.roster .col-search{width:42px}
.roster td{vertical-align:middle}.roster .member-world{display:grid;gap:4px;min-width:0}.roster .member-world select{font-size:11px;height:29px;padding:4px 5px;border:1px solid var(--line);border-radius:6px}.roster .member-world select:disabled{opacity:.6;cursor:not-allowed}.roster .member-world select:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.member-power{display:grid;gap:4px;min-width:0}.member-power-control{display:flex;align-items:stretch;gap:4px}.roster .member-power-control input{min-width:0;flex:1;border:1px solid var(--line);font-variant-numeric:tabular-nums}.power-lookup{display:inline-flex;align-items:center;justify-content:center;flex:0 0 29px;width:29px;min-height:31px;padding:5px;border:1px solid var(--line);border-radius:7px;color:var(--accent);background:var(--accent-light);cursor:pointer}.power-lookup svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.power-lookup:hover{border-color:var(--accent)}.power-lookup:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.power-lookup:disabled{opacity:.6;cursor:wait}.power-lookup[aria-busy="true"] svg{animation:lookup-rotate 1s linear infinite}
.power-lookup-status{display:block;min-height:14px;line-height:1.45;font-size:9px;color:var(--muted);overflow-wrap:anywhere}.power-lookup-status[data-state="success"]{color:var(--accent);white-space:pre-line;font-variant-numeric:tabular-nums}.power-lookup-status[data-state="error"]{color:var(--danger)}.power-lookup-status[data-state="loading"],.power-lookup-status[data-state="waiting"]{color:var(--accent)}.power-lookup-status[data-state="missing"]{color:var(--muted)}
.lookup-help{margin:10px 20px 0;padding:10px 12px;background:var(--surface2);border:1px solid var(--line);border-radius:9px;font-size:11px;line-height:1.75;color:var(--muted)}.lookup-help summary{font-weight:650;color:var(--ink);cursor:pointer}.lookup-help p{margin:6px 0 0}.lookup-help strong{color:var(--ink)}.lookup-help .auto-tag{margin:0 5px 0 0}.lookup-help code{font:inherit;color:var(--ink)}
.official-power{display:flex;align-items:center;gap:4px;flex-wrap:wrap;font-size:9px;line-height:1.4;color:var(--muted)}.official-power strong{color:var(--ink);font-weight:650;font-variant-numeric:tabular-nums}.official-power .metric-label{padding:1px 4px;border-radius:4px;background:var(--accent-light);color:var(--accent);white-space:nowrap}
@keyframes lookup-rotate{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.power-lookup[aria-busy="true"] svg{animation:none}}
@media(max-width:760px){.roster,.roster.auto-directions{min-width:740px}.roster .col-name{width:108px}.roster .col-world{width:108px}.roster .col-power,.roster.auto-directions .col-power{width:130px}.lookup-help{margin:10px 14px 0;padding:9px 10px;font-size:10px}.power-lookup{min-height:33px;flex-basis:30px;width:30px}.roster .member-world select{height:31px}.power-lookup-status{font-size:9px}}
@media print{.power-lookup,.power-lookup-status,.lookup-help{display:none}}

/* v1.4.2 — compact S3 columns and a roster-wide refresh action. */
.roster:not(.auto-directions){min-width:704px}
.roster:not(.auto-directions) .col-name{width:112px}
.roster:not(.auto-directions) .col-world{width:104px}
.roster:not(.auto-directions) .col-job{width:80px}
.roster:not(.auto-directions) .col-power{width:112px}
.roster:not(.auto-directions) .col-clock{width:126px}
.roster:not(.auto-directions) .search-cell{position:static}
.roster:not(.auto-directions) [data-field="clock"]{padding-right:18px}
.roster-card .card-head{flex-wrap:wrap;align-items:flex-start}
.roster-tools{margin-left:auto}
.bulk-power-btn{color:var(--accent);background:var(--accent-light)}
.bulk-power-btn[aria-busy="true"]{cursor:pointer}
.bulk-power-status{margin:0 20px 12px;padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface2);color:var(--muted);font-size:11px;line-height:1.7;overflow-wrap:anywhere}
.bulk-power-status[hidden]{display:none}
@media(max-width:760px){.bulk-power-status{margin:0 14px 10px;font-size:10px}}
@media print{.bulk-power-status,.bulk-power-btn{display:none}}

/* v1.4.3 — labelled parties and a remembered S4 direction column. */
.roster .party-divider,.roster .party-member{--party-ink:#315fad;--party-soft:#edf3ff;--party-line:#88ade8}
.roster [data-party-heading="2"],.roster [data-party="2"]{--party-ink:#237358;--party-soft:#e9f6ef;--party-line:#78bfa1}
[data-theme="dark"] .roster .party-divider,[data-theme="dark"] .roster .party-member{--party-ink:#b2cbff;--party-soft:#28364e;--party-line:#738ebe}
[data-theme="dark"] .roster [data-party-heading="2"],[data-theme="dark"] .roster [data-party="2"]{--party-ink:#9bdfc2;--party-soft:#253d35;--party-line:#67a88d}
.roster .party-divider>td{padding:9px 8px;text-align:left;font-size:10px;color:var(--muted);background:var(--surface2);border-bottom:1px solid var(--line)}
.roster .party-divider[data-party-heading="2"]>td{border-top:2px solid var(--line)}
.party-heading-label{display:flex;align-items:center;gap:9px}
.party-badge{display:inline-flex;align-items:center;padding:3px 8px;border-radius:6px;color:var(--party-ink);background:var(--party-soft);font-size:11px;font-weight:750}
.roster .party-member>td:first-child{box-shadow:inset 3px 0 var(--party-line);color:var(--party-ink);font-variant-numeric:tabular-nums}
.clock-hide-btn{margin-left:5px;padding:2px 4px;min-height:25px;border:1px solid var(--line);border-radius:5px;background:var(--surface2);color:var(--muted);font-size:9px;line-height:1.3;vertical-align:middle;white-space:nowrap}
.clock-hide-btn:hover{color:var(--accent);border-color:var(--accent)}
.clock-show-btn{color:var(--accent);background:var(--accent-light)}
.clock-show-btn[hidden],#clockHeader[hidden],.roster [data-clock-cell][hidden]{display:none}
.roster.auto-directions.clock-column-hidden{min-width:622px}
@media(max-width:760px){.roster.auto-directions.clock-column-hidden{min-width:600px}}
@media print{.clock-hide-btn,.clock-show-btn{display:none}}

/* v2.2 — attendance and widths shared by narrow and wide roster layouts. */
.roster,.roster:not(.auto-directions){min-width:800px}
.roster.auto-directions{min-width:840px}
.roster .col-no{width:28px}
.roster .col-absent{width:40px}
.roster .col-name,.roster:not(.auto-directions) .col-name{width:134px}
.roster .col-world,.roster:not(.auto-directions) .col-world{width:114px}
.roster .col-job,.roster.auto-directions .col-job,.roster:not(.auto-directions) .col-job{width:86px}
.roster .col-power,.roster.auto-directions .col-power,.roster:not(.auto-directions) .col-power{width:132px}
.roster .col-clock,.roster:not(.auto-directions) .col-clock{width:124px}
.roster.auto-directions .col-clock{width:164px}
.roster .col-search{width:42px}
.roster.auto-directions.clock-column-hidden{min-width:676px}
.roster .absent-heading,.roster .absent-cell{text-align:center}
.absent-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:30px;min-height:36px;cursor:pointer;border-radius:7px}
.roster .absent-toggle input[type="checkbox"]{width:17px;height:17px;min-width:17px;padding:0;margin:0;accent-color:var(--accent);cursor:pointer}
.absent-toggle:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:1px}
.absent-toggle:hover{background:var(--accent-light)}
.roster .party-member.is-absent>td{background:var(--surface2)}
.roster .party-member.is-absent input.name{color:var(--muted);text-decoration:line-through}
.roster .party-member.is-absent .absent-toggle{background:var(--accent-light)}
.absence-help{margin:10px 20px 0;font-size:11px;line-height:1.8;color:var(--muted)}
.absence-help summary{cursor:pointer}
.absence-help p{margin:6px 0 0}
.absence-help strong{color:var(--ink);font-weight:650}
@media(max-width:760px){.absence-help{margin-left:14px;margin-right:14px;font-size:10px}}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0}
.absent-direction{display:inline-block;padding:6px 8px;font-size:11px;color:var(--muted);font-weight:600}

/* v2.2.1 — absence stays recognizable in both themes without widening the table. */
.roster th.absent-heading{padding-left:3px;padding-right:3px}
.absence-label{display:inline-flex;align-items:center;justify-content:center;padding:3px 4px;border:1px solid #f0adb8;border-radius:6px;background:#fff0f2;color:#aa1934;font-size:10px;font-weight:800;line-height:1.4;white-space:nowrap}
[data-theme="dark"] .absence-label{color:#ffbbc7;background:#452a32;border-color:#84515e}
