:root {
    --bg: #0b1220;
    --panel: #121c2f;
    --panel-2: #1a2740;
    --text: #eef4ff;
    --muted: #9db0d0;
    --border: #293754;
    --accent: #63a4ff;
    --danger: #d9534f;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #08101d 0%, #0d1728 100%);
    color: var(--text);
}
.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}
header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}
h1 { margin: 0 0 6px; }
p { margin: 0; color: var(--muted); }
.identity-box, .status-card, .panel {
    background: rgba(18, 28, 47, 0.95);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.identity-box {
    padding: 12px;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: flex-start;
}

header > div:first-child {
    flex: 1 1 auto;
}

.top-admin-link {
    margin-bottom: 6px;
}
.identity-box hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

.identity-box .two-col {
    grid-template-columns: 1fr;
}

.identity-box input,
.identity-box button {
    padding: 9px 10px;
}

.identity-box .admin-status {
    margin-bottom: 4px;
}
.identity-box label, label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
input, select, button {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
}
input[readonly] {
    opacity: 0.9;
}
input:disabled, button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
button {
    cursor: pointer;
    font-weight: 700;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
.status-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.status-bar-4 {
    grid-template-columns: repeat(4, 1fr);
}
.status-card {
    padding: 14px;
}
.status-card .label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.panel {
    padding: 16px;
}
.chat-panel, .pick-panel, .board-panel, .order-panel {
    min-height: 0;
}
.chat-panel {
    align-self: start;
}
.pick-panel {
    align-self: start;
}
.team-detail-panel {
    align-self: start;
}
.messages {
    height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0f1726;
    padding: 12px;
    margin-bottom: 12px;
}
.message {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.message:last-child { border-bottom: none; }
.message-meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}
.inline-form {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 10px;
}
.stack-form > * + * { margin-top: 12px; }
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.compact-gap {
    margin-top: 10px;
}
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    white-space: nowrap;
}
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.muted { color: var(--muted); margin-bottom: 12px; }
.teams-editor {
    display: grid;
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
}
.team-row {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 1fr 110px;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0f1726;
}
.team-row.traded {
    border-color: rgba(99, 164, 255, 0.45);
    box-shadow: inset 0 0 0 1px rgba(99, 164, 255, 0.15);
}
.danger-zone { margin-top: 14px; }
.danger { background: var(--danger); border-color: #b83d39; }
.notice {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: rgba(99, 164, 255, 0.16);
    border: 1px solid rgba(99, 164, 255, 0.25);
}
.notice.error {
    background: rgba(217, 83, 79, 0.14);
    border-color: rgba(217, 83, 79, 0.3);
}
.admin-status {
    font-weight: 700;
}
@media (max-width: 1200px) {
    .team-row {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 1000px) {
    .grid, .status-bar, .status-bar-4 { grid-template-columns: 1fr; }
    header { flex-direction: column; align-items: stretch; }
    .identity-box { width: 100%; min-width: 0; max-width: none; }
}


.team-identity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
}
.team-identity-small {
    min-height: 28px;
}
.team-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
}
.team-identity-small .team-logo {
    width: 26px;
    height: 26px;
}
.team-logo-fallback {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: #223451;
    border: 1px solid var(--border);
}
.team-identity-small .team-logo-fallback {
    width: 26px;
    height: 26px;
    font-size: 10px;
}
.team-name-inline {
    font-size: 13px;
    color: var(--text);
}
.team-preview {
    min-height: 30px;
    margin-bottom: 8px;
}
.clock-text {
    font-size: 14px;
    color: var(--text);
}
#currentPickText, #originalPickText {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.team-identity-clickable {
    cursor: pointer;
    border-radius: 999px;
    padding: 2px 4px;
    transition: transform 0.15s ease, background 0.15s ease;
}
.team-identity-clickable:hover,
.team-identity-clickable:focus-visible {
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
    outline: none;
}
.team-detail-panel {
    grid-column: span 2;
}
.team-detail,
.team-detail-empty {
    min-height: 180px;
}
.team-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.inset-panel {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}
.detail-list {
    display: grid;
    gap: 10px;
}
.detail-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}
.slot-pill {
    display: inline-block;
    padding: 6px 10px;
    margin: 0 8px 8px 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    font-weight: 700;
}
.slot-pill-secondary {
    background: rgba(124, 192, 255, 0.1);
}
.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.mt-16 {
    margin-top: 16px;
}
@media (max-width: 1000px) {
    .team-detail-panel {
        grid-column: span 1;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.info-panel { margin-bottom: 16px; }
.tool-grid { display:grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items:end; }
.tool-actions { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-grid code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 6px; }
.team-row { grid-template-columns: 46px 80px 1fr 1fr 1fr 110px; }
.drag-handle { display:flex; align-items:center; justify-content:center; min-height: 42px; border:1px dashed var(--border); border-radius:10px; cursor:grab; user-select:none; color: var(--muted); background: rgba(255,255,255,0.03); font-size: 20px; }
.team-row.dragging { opacity: 0.55; }
.team-row.drag-over { outline: 2px solid rgba(99, 164, 255, 0.65); transform: translateY(-1px); }
@media (max-width: 1200px) {
  .tool-grid, .tool-actions { grid-template-columns: 1fr; }
  .team-row { grid-template-columns: 1fr 1fr; }
  .drag-handle { min-height: 36px; }
}

.secondary-btn { background: #1d2b45; }
.small-text { font-size: 12px; margin-top: 8px; }
.tool-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: end; }
.tool-actions { display: grid; gap: 10px; }
.panel-header-row, .round-toolbar-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.round-toggle-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.round-toggle-btn { width: auto; padding: 10px 14px; }
.round-toggle-btn.active { background: var(--accent); color: #08101d; border-color: var(--accent); }
.round-chip { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px; background: #16233b; border: 1px solid var(--border); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.team-clickable { cursor: pointer; }
.row-actions { display: grid; gap: 8px; align-items: end; }
.drag-handle { text-align: center; font-size: 22px; padding: 8px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); }
.team-row { grid-template-columns: 90px 1fr 1fr 1fr 120px 1fr 1fr 140px 140px; }
.team-row.dragging { opacity: .55; }
.password-clear-box { display: flex; align-items: center; }
.password-clear-box label { display: flex; align-items: center; gap: 8px; margin: 0; }
.password-clear-box input[type="checkbox"] { width: auto; }
.clock-text { display: inline-block; margin-left: 8px; vertical-align: middle; }
.team-detail-empty, .team-detail { min-height: 120px; }
.team-detail-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-card { padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: #0f1726; margin-bottom: 8px; }
.inset-panel { background: #0f1726; }
.slot-pill { display: inline-block; padding: 6px 10px; border-radius: 999px; background: #20314d; margin: 0 6px 6px 0; }
.slot-pill-secondary { background: #15253c; }
.mt-16 { margin-top: 16px; }
@media (max-width: 1300px) { .team-row { grid-template-columns: 1fr 1fr; } .tool-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .detail-grid, .round-toolbar-header, .panel-header-row { grid-template-columns: 1fr; display: grid; } }


.edit-pick-btn { white-space: nowrap; }


.bot-message {
    border-left: 3px solid #5aa0ff;
    padding-left: 10px;
}


.team-row {
    grid-template-columns: 80px minmax(220px, 1.2fr) minmax(220px, 1.2fr) minmax(280px, 1.6fr) 90px repeat(4, minmax(140px, 1fr));
    align-items: end;
}

.slot-col-team input,
.slot-col-team select {
    min-width: 220px;
}

.slot-col-note input {
    min-width: 280px;
}

@media (max-width: 1200px) {
    .team-row {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }
}

.wrap-form { flex-wrap: wrap; }
.admin-accounts-list { display: grid; gap: 10px; margin-top: 12px; }
.admin-account-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; }


.round-focus-row {
    background: rgba(255, 255, 255, 0.04);
}


.top-admin-link { margin-bottom: 10px; }
.top-admin-link a { font-weight: 600; text-decoration: none; }
.narrow-container { max-width: 1100px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }


.page-header {
    display: block;
    margin-bottom: 16px;
}

.hero-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-login-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    align-items: start;
}

.login-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 14px;
    gap: 8px;
}

.login-card-title {
    margin: 0 0 4px;
    font-size: 18px;
}

.login-card .admin-status {
    margin: 0 0 4px;
}

.login-card button {
    width: 100%;
}

@media (max-width: 1000px) {
    .top-login-grid {
        grid-template-columns: 1fr;
    }
}


.top-login-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 260px));
    gap: 14px;
    align-items: start;
    margin-bottom: 18px;
}

.team-detail-panel {
    max-height: 320px;
    overflow: hidden;
}

#teamDetail {
    max-height: 220px;
    overflow-y: auto;
}

.team-detail-panel p.muted {
    margin-bottom: 8px;
}

@media (max-width: 1000px) {
    .top-login-grid {
        grid-template-columns: 1fr;
    }
    .messages {
        height: 180px;
    }
    .team-detail-panel {
        max-height: none;
    }
    #teamDetail {
        max-height: none;
    }
}


/* v29 layout tweaks */
.grid {
    grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
    grid-template-areas:
        "chat board"
        "pick board"
        "team team"
        "order order";
    align-items: start;
}
.chat-panel { grid-area: chat; }
.pick-panel { grid-area: pick; }
.board-panel { grid-area: board; }
.team-detail-panel {
    grid-area: team;
    grid-column: auto;
    max-height: 250px;
    overflow: hidden;
}
.order-panel { grid-area: order; }
.messages {
    height: 150px;
}
#teamDetail {
    max-height: 140px;
    overflow-y: auto;
}
.team-detail-empty, .team-detail {
    min-height: 80px;
}
.team-detail-panel .detail-grid {
    gap: 10px;
}
.team-detail-panel .inset-panel {
    padding: 10px;
}
.team-detail-panel .detail-card {
    padding: 8px 10px;
    margin-bottom: 6px;
}
.team-detail-panel .slot-pill {
    padding: 5px 8px;
    margin: 0 5px 5px 0;
}
@media (max-width: 1000px) {
    .grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "chat"
            "pick"
            "board"
            "team"
            "order";
    }
    .messages {
        height: 160px;
    }
    .team-detail-panel {
        max-height: none;
    }
    #teamDetail {
        max-height: none;
    }
}


.order-panel { grid-column: span 2; }
.team-detail-panel { max-height: 420px; }
.team-detail, .team-detail-empty { max-height: 300px; overflow-y: auto; }
@media (max-width: 1000px) { .order-panel { grid-column: span 1; } }


/* v31: make Team Details as wide as Draft Slots / Traded Picks */
.team-detail-panel,
.order-panel {
    grid-column: 1 / -1;
}

@media (max-width: 1000px) {
    .team-detail-panel,
    .order-panel {
        grid-column: 1;
    }
}


.slot-col-overall { min-width: 110px; }
.slot-col-overall input[readonly] { background: var(--panel-2); color: var(--text); font-weight: 600; }

/* v33: place Submit Pick beside Chat and move Draft Board below both */
.grid {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    grid-template-areas:
        "chat pick"
        "board board"
        "team team"
        "order order";
    align-items: start;
}

.chat-panel {
    grid-area: chat;
}

.pick-panel {
    grid-area: pick;
}

.board-panel {
    grid-area: board;
    grid-column: 1 / -1;
}

.team-detail-panel {
    grid-area: team;
    grid-column: 1 / -1;
}

.order-panel {
    grid-area: order;
    grid-column: 1 / -1;
}

@media (max-width: 1000px) {
    .grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "chat"
            "pick"
            "board"
            "team"
            "order";
    }

    .board-panel,
    .team-detail-panel,
    .order-panel {
        grid-column: 1;
    }
}


/* v34: keep Overall and Slot visible in Draft Slots */
.team-row {
    grid-template-columns: 110px 90px minmax(260px, 1.15fr) minmax(260px, 1.15fr) 120px;
    align-items: end;
}
/* When a time slot column is present it prepends itself */
.team-row.has-timeslot {
    grid-template-columns: minmax(280px, 1.4fr) 110px 90px minmax(220px, 1fr) minmax(220px, 1fr) 120px;
}
.slot-col-overall, .slot-col-slotnum { min-width: 90px; }
.slot-col-overall input, .slot-col-slotnum input { text-align: center; font-weight: 700; }
.slot-readonly { background: var(--panel-2); color: var(--text); }
@media (max-width: 1200px) {
    .team-row,
    .team-row.has-timeslot { grid-template-columns: 1fr 1fr; }
}


/* v39: move round picker into Draft Slots section */
.order-round-toolbar {
    margin: 0 0 12px;
}
.order-round-toolbar .round-toggle-bar {
    justify-content: flex-start;
}


/* v42: remove Trade Note from main Draft Slots and enlarge Team Details when a team is selected */
.team-detail-panel.selected-team-open,
.team-detail-panel.selected-team-open #teamDetail,
.team-detail-panel.selected-team-open .team-detail {
    max-height: 720px;
}
.team-detail-panel.selected-team-open #teamDetail {
    min-height: 520px;
}
@media (max-width: 1000px) {
    .team-detail-panel.selected-team-open,
    .team-detail-panel.selected-team-open #teamDetail,
    .team-detail-panel.selected-team-open .team-detail {
        max-height: 620px;
    }
    .team-detail-panel.selected-team-open #teamDetail {
        min-height: 420px;
    }
}


.upcoming-panel {
    margin: 14px 0 18px;
    background: transparent;
    border: none;
    padding: 0;
}
.upcoming-picks-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 10px;
}
.upcoming-card {
    min-height: 92px;
}
.upcoming-team {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
}
@media (max-width: 1000px) {
    .upcoming-picks-bar {
        grid-template-columns: 1fr;
    }
}

.order-panel .panel-header-row { align-items: center; }


.board-round-toolbar {
    margin: 0 0 12px;
}
.pick-tools-row {
    margin-top: 6px;
    align-items: end;
}
.pick-tools-row button {
    min-width: 120px;
}


.pick-tools-row {
    justify-content: flex-start;
}

.team-account-row input[type="file"] {
    max-width: 220px;
}
.team-account-row select {
    min-width: 170px;
}


.slot-pill-available {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(99, 164, 255, 0.25);
}


/* v61: make Team Details trade history fully scrollable */
.team-detail-panel {
    overflow: visible;
}
#teamDetail,
.team-detail,
.team-detail-empty {
    overflow-y: auto;
    padding-right: 6px;
}
.team-detail .inset-panel {
    overflow: visible;
}


/* v62: make Chat panel height match Submit Pick panel more closely */
.chat-panel,
.pick-panel {
    align-self: stretch;
}
.chat-panel .messages {
    height: 360px;
}
@media (max-width: 1000px) {
    .chat-panel .messages {
        height: 260px;
    }
}


/* v63: force Team Details container to scroll all the way through trade history */
.team-detail-panel {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

#teamDetail {
    max-height: 720px !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 24px !important;
}

.team-detail,
.team-detail-empty {
    max-height: none !important;
    overflow: visible !important;
}

.team-detail .detail-grid {
    align-items: start;
}

.team-detail .inset-panel {
    max-height: none !important;
    overflow: visible !important;
}

@media (max-width: 1000px) {
    #teamDetail {
        max-height: 560px !important;
    }
}


#availablePlayersLink {
    display: inline;
}


.tool-sections {
    display: grid;
    gap: 14px;
}
.tool-subpanel {
    padding: 14px;
}



.status-bar-6 {
    grid-template-columns: repeat(6, 1fr);
}
@media (max-width: 1200px) {
    .status-bar-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 700px) {
    .status-bar-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}
.pick-tools-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 900px) {
    .pick-tools-row {
        grid-template-columns: 1fr 1fr;
    }
}


#pickTimerMinutes, #extensionMinutes, #maxExtensions {
    width: 100%;
}


.tool-subpanel .tool-actions {
    align-items: end;
}


.admin-account-edit-row {
    align-items: center;
    gap: 12px;
}
.admin-account-inline-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.admin-password-reset-input {
    min-width: 220px;
}


.logged-in-team-logo-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-2);
}
#loggedInTeamLogo .team-identity {
    justify-content: flex-start;
}


.flash-announcement {
    margin-bottom: 16px;
    border-width: 2px;
}
.flash-active {
    animation: draftFlashPulse 1s ease-in-out 6;
}
@keyframes draftFlashPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.02); filter: brightness(1.35); }
}


.compact-panel {
    margin-bottom: 20px;
}
.logged-in-users-list {
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    background: #0f1726;
}
.login-presence-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.login-presence-row:last-child {
    border-bottom: none;
}


#loggedInUsersPanel.compact-login-panel {
    align-self: start;
    min-width: 280px;
    max-width: 340px;
    margin-bottom: 20px;
}
.logged-in-users-list {
    max-height: 140px;
}
@media (max-width: 1000px) {
    #loggedInUsersPanel.compact-login-panel {
        max-width: 100%;
        min-width: 0;
    }
}


#loggedInUsersPanel.compact-login-panel {
    align-self: start;
    min-width: 280px;
    max-width: 340px;
    margin-bottom: 20px;
    float: right;
    margin-left: 16px;
}
.logged-in-users-list {
    max-height: 140px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    background: #0f1726;
}
.login-presence-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.login-presence-row:last-child { border-bottom: none; }

@media (max-width: 1000px) {
    #loggedInUsersPanel.compact-login-panel {
        float: none;
        max-width: 100%;
        min-width: 0;
        margin-left: 0;
    }
}


#loggedInUsersPanel.top-right-login-panel {
    float: right;
    width: 320px;
    max-width: 320px;
    margin-left: 16px;
    margin-bottom: 16px;
}

@media (max-width: 1000px) {
    #loggedInUsersPanel.top-right-login-panel {
        float: none;
        width: auto;
        max-width: 100%;
        margin-left: 0;
    }
}


/* v113 force Logged In panel beside Admin Login */
.top-right-login-panel {
    float: right !important;
    clear: none !important;
    width: 320px !important;
    max-width: 320px !important;
    margin: 0 0 16px 16px !important;
    position: relative !important;
    z-index: 2 !important;
}

.logged-in-users-list {
    max-height: 140px !important;
    overflow-y: auto !important;
}

.status-bar,
.upcoming-panel,
.grid {
    clear: both;
}

@media (max-width: 1000px) {
    .top-right-login-panel {
        float: none !important;
        width: auto !important;
        max-width: 100% !important;
        margin: 0 0 16px 0 !important;
    }
}


/* v114 restore Logged In panel beside Admin Login */
.top-login-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

#loggedInUsersPanel.top-right-login-panel {
    display: block !important;
    width: 320px;
    max-width: 320px;
    margin: 0 !important;
}

#loggedInUsersPanel .panel-header-row h2 {
    margin: 0;
}

.logged-in-users-list {
    max-height: 140px !important;
    overflow-y: auto !important;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    background: #0f1726;
}

@media (max-width: 1000px) {
    .top-login-row {
        grid-template-columns: 1fr;
    }

    #loggedInUsersPanel.top-right-login-panel {
        width: auto;
        max-width: 100%;
    }
}


.hover-player-trigger {
    cursor: help;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}

.player-hover-card {
    position: absolute;
    z-index: 1000;
    width: 280px;
    max-width: min(280px, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0f1726;
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
    pointer-events: none;
}

.player-hover-header {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.player-hover-image {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
}

.player-hover-name {
    font-weight: 700;
    line-height: 1.2;
}

.player-hover-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.player-hover-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.player-hover-stat {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
}

.player-hover-stat span {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .player-hover-card {
        display: none;
    }
}


.player-search-wrap {
    position: relative;
}
.player-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1200;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0f1726;
    box-shadow: 0 10px 24px rgba(0,0,0,0.3);
    max-height: 260px;
    overflow-y: auto;
}
.player-suggestion {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.player-suggestion:last-child {
    border-bottom: 0;
}
.player-suggestion:hover,
.player-suggestion:focus {
    background: rgba(255,255,255,0.06);
}
.player-suggestion-name {
    font-weight: 600;
}
.player-suggestion-meta {
    font-size: 12px;
    color: var(--muted);
}
.player-suggestion.empty {
    cursor: default;
}


.player-search-wrap {
    position: relative;
    overflow: visible;
}
.pick-panel,
.stack-form,
.two-col {
    overflow: visible;
}
.player-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 9999;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0f1726;
    box-shadow: 0 10px 24px rgba(0,0,0,0.3);
    max-height: 260px;
    overflow-y: auto;
}


#newTeamPassword {
    width: 100%;
}


#newTeamPassword {
    width: 100%;
}

#newTeamPassword { width: 100%; }


.team-detail-select-wrap {
    min-width: 220px;
}
.team-detail-select-wrap select {
    width: 100%;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}


.login-form-fallback {
    margin: 0;
}

.trade-picks-box{min-height:240px;max-height:420px;overflow:auto;border:1px solid var(--line);border-radius:14px;padding:10px;background:rgba(13,20,48,.72)}
.trade-pick-row{display:flex;gap:10px;align-items:flex-start;padding:8px 6px;border-bottom:1px solid rgba(255,255,255,.06);cursor:pointer}
.trade-pick-row:last-child{border-bottom:none}
.trade-pick-row input{margin-top:4px}


.admin-page-grid{display:grid;grid-template-columns:260px minmax(0,1fr);gap:18px;align-items:start}
.admin-sidebar-panel{position:sticky;top:16px;align-self:start}
.section-toggle-list{display:grid;gap:10px}
.section-toggle-item{display:flex;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:rgba(13,20,48,.72)}
.section-toggle-item input[type="checkbox"]{width:auto;margin:0}
@media (max-width:980px){
  .admin-page-grid{grid-template-columns:1fr}
  .admin-sidebar-panel{position:static}
}


.admin-page-grid{display:grid;grid-template-columns:260px minmax(0,1fr);gap:18px;align-items:start}
.admin-nav-panel{position:sticky;top:16px;align-self:start}
.admin-nav-list{display:grid;gap:10px}
.admin-nav-btn{width:100%;text-align:left;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:rgba(13,20,48,.72);color:var(--text);cursor:pointer}
.admin-nav-btn.active{outline:2px solid rgba(122,162,255,.65)}
@media (max-width:980px){
  .admin-page-grid{grid-template-columns:1fr}
  .admin-nav-panel{position:static}
}

/* Time Slot columns in Draft Slots editor */
.slot-col-timeslot {
    min-width: 0;
}
.ts-row-inputs {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}
.ts-row-inputs input[type="date"],
.ts-row-inputs input[type="time"] {
    padding: 9px 8px;
    min-width: 0;
    flex: 1 1 0;
}
.ts-row-inputs input[type="date"] { max-width: 150px; }
.ts-row-inputs input[type="time"] { max-width: 100px; }
.ts-row-inputs .ts-save-btn { flex-shrink: 0; }
.ts-status-badge {
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.ts-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}
.ts-global-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    margin-bottom: 10px;
}

.team-row.has-timeslot {
    border-color: rgba(99, 164, 255, 0.25);
}

/* Refresh interval control */
.refresh-control {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    vertical-align: middle;
}
.refresh-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.refresh-dot-on {
    background: #6dd68a;
    box-shadow: 0 0 5px rgba(109, 214, 138, 0.6);
    animation: refreshPulse 2s ease-in-out infinite;
}
.refresh-dot-off {
    background: var(--muted);
    box-shadow: none;
    animation: none;
}
@keyframes refreshPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
#refreshIntervalSelect {
    width: auto;
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 6px;
    height: auto;
    display: inline-block;
}
