/* EstLUG Sets — scoped to .esl-app so the site theme is left alone. */
.esl-app, .esl-dialog {
	--bg: #fff; --surface: #f5f6f8; --surface2: #eceef2; --border: #dcdfe5; --text: #1b1f24; --muted: #667085;
	--accent: #1f5fbf; --accent-2: #174a96; --accent-ink: #fff; --danger: #b42318; --ok: #137a3a; --warn: #9a6200;
	--r: 8px;
	color: var(--text); font-size: 14.5px; line-height: 1.45; text-align: left;
}
.esl-app { max-width: 100%; }
.esl-app *, .esl-app *::before, .esl-app *::after, .esl-dialog *, .esl-dialog *::before, .esl-dialog *::after { box-sizing: border-box; }
.esl-app button, .esl-app input, .esl-app select, .esl-app textarea,
.esl-dialog button, .esl-dialog input, .esl-dialog select, .esl-dialog textarea { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
.esl-app input:not([type=checkbox]):not([type=radio]):not([type=file]), .esl-app select, .esl-app textarea,
.esl-dialog input:not([type=checkbox]):not([type=radio]):not([type=file]), .esl-dialog select, .esl-dialog textarea {
	min-height: 36px; padding: 6px 9px; margin: 0; width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; box-shadow: none; max-width: 100%;
}
.esl-app select, .esl-dialog select { width: auto; max-width: 100%; }
.esl-app input:focus, .esl-app select:focus, .esl-app textarea:focus,
.esl-dialog input:focus, .esl-dialog select:focus, .esl-dialog textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.esl-app h2, .esl-app h3, .esl-dialog h2, .esl-dialog h3 { font-family: inherit; letter-spacing: normal; text-transform: none; }
.esl-app a { color: var(--accent); }
.esl-muted { color: var(--muted); }
.esl-grow { flex: 1 1 auto; }
.esl-h { margin: 0; font-size: 20px; line-height: 1.25; }
.esl-app h3, .esl-dialog h3 { font-size: 15px; margin: 18px 0 8px; }
.esl-crumb { margin: 0 0 6px; }
.neg { color: var(--danger); }

/* Nav */
.esl-nav { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.esl-nav a { padding: 9px 13px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.esl-nav a:hover { color: var(--text); }
.esl-nav a.on { color: var(--accent); border-bottom-color: var(--accent); }
.esl-user { color: var(--muted); font-size: 13px; padding: 0 6px; }
.esl-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 12px; }
.esl-tabs button { border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13px; }
.esl-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Buttons */
.esl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 6px 13px; border-radius: 6px; cursor: pointer;
	background: var(--bg); border: 1px solid var(--border); color: var(--text); font-weight: 600; white-space: nowrap; line-height: 1.2; text-decoration: none; }
.esl-btn:hover:not(:disabled) { background: var(--surface); }
.esl-btn:disabled { opacity: .5; cursor: default; }
.esl-app .esl-btn.primary, .esl-dialog .esl-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.esl-app .esl-btn.primary:hover:not(:disabled), .esl-dialog .esl-btn.primary:hover:not(:disabled) { background: var(--accent-2); }
.esl-app .esl-btn.danger, .esl-dialog .esl-btn.danger { color: var(--danger); border-color: #f1c0bb; }
.esl-btn.ghost { border-color: transparent; background: none; }
.esl-btn.small { min-height: 28px; padding: 3px 9px; font-size: 13px; }
.esl-btn.on { background: #fff4d6; border-color: #f0c96a; }
.esl-btn small { display: block; font-weight: 400; font-size: 11px; opacity: .8; }
.esl-link { background: none; border: 0; padding: 0 2px; color: var(--accent); cursor: pointer; text-decoration: underline; font-size: 13px; }
.esl-actions { white-space: nowrap; }
.esl-actions .esl-btn { margin-left: 4px; }

/* Toolbar & tiles */
.esl-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.esl-toolbar > select { flex: 0 1 auto; }
.esl-search { flex: 1 1 220px; min-width: 0; }
.esl-app .esl-toolbar .esl-search { width: auto; }
.esl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.esl-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; }
.esl-tile b { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }
.esl-tile span { color: var(--muted); font-size: 13px; }
.esl-tile.warn { background: #fff6e0; border-color: #f0c96a; cursor: pointer; }
.esl-bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; background: #eaf1fc; border: 1px solid #c4d6f3; border-radius: var(--r); margin-bottom: 10px; }
.esl-bulkbar.idle { background: var(--surface); border-color: var(--border); }
.esl-bulkbar.idle b { font-weight: 400; color: var(--muted); }
.esl-count { color: var(--muted); font-size: 13px; min-height: 1.2em; margin-bottom: 4px; }
.esl-more { text-align: center; }
.esl-empty { padding: 26px 10px; text-align: center; color: var(--muted); }

/* Tables */
.esl-table-wrap { border: 1px solid var(--border); border-radius: var(--r); overflow: auto; background: var(--bg); }
.esl-table-wrap.small { max-height: 300px; }
.esl-table { width: 100%; border-collapse: collapse; margin: 0; border: 0; font-size: 14px; }
.esl-table th, .esl-table td { padding: 7px 9px; border: 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; background: none; }
.esl-table thead th { position: sticky; top: 0; background: var(--surface); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; cursor: pointer; user-select: none; z-index: 1; }
.esl-table tbody tr { cursor: pointer; }
.esl-table tbody tr:hover { background: #f8fafc; }
.esl-table tbody tr.sel { background: #eef4fd; }
.esl-table tbody tr.grey, .grey { opacity: .5; }
.esl-table tbody tr:last-child td { border-bottom: 0; }
.esl-table tr.total td { font-weight: 700; border-top: 2px solid var(--border); }
.esl-table.small td, .esl-table.small th { padding: 5px 7px; font-size: 13px; }
.esl-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.esl-table td.id { font-weight: 700; color: var(--muted); }
.esl-table td.img { width: 58px; padding-right: 0; }
.esl-cb { width: 32px; }
.setcell b { display: block; line-height: 1.25; }
.setcell small, .esl-table td small { display: block; color: var(--muted); font-size: 12px; }
.esl-need { background: #fff4d6; }
.esl-need select { border-color: #e0a400 !important; }

/* Images, badges, chips */
/* Themes often style every <img>; pin our thumbnails hard. */
.esl-app img.esl-img, .esl-dialog img.esl-img, .esl-app .esl-img, .esl-dialog .esl-img {
	width: 52px !important; height: 40px !important; min-width: 0 !important; max-width: 52px !important; max-height: 40px !important;
	object-fit: contain; display: block; flex: none; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important;
	background: #fff; border-radius: 4px; }
.esl-app .esl-img.md, .esl-dialog .esl-img.md { width: 72px !important; height: 54px !important; max-width: 72px !important; max-height: 54px !important; }
.esl-app .esl-img.lg, .esl-dialog .esl-img.lg { width: 92px !important; height: 70px !important; max-width: 92px !important; max-height: 70px !important; }
.esl-img-empty { background: var(--surface2); }
.esl-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface2); color: #344054; }
.s-planned { background: #efe9fb; color: #5b3aa8; } .s-building { background: #fff1cc; color: #8a5a00; } .s-built { background: #fde6cf; color: #9a4b00; }
.s-display { background: #dff3e6; color: #146c3a; } .s-transit { background: #e3edfc; color: #1d4ed8; } .s-warehouse { background: #eceef2; color: #344054; }
.s-missing { background: #fde5e2; color: #b42318; } .s-handed { background: #e7e7e7; color: #555; }
.b-warehouse, .b-venue, .b-builder, .b-transit, .b-handed, .b-missing, .b-discarded { background: #fff; border: 1px dashed #98a2b3; color: #475467; font-weight: 500; }
.r-open { background: #dff3e6; color: #146c3a; } .r-closed { background: #e7e7e7; } .r-draft { background: #fff1cc; color: #8a5a00; }
.esl-contents { display: inline-flex; gap: 2px; vertical-align: middle; }
.esl-contents span { font: 700 10px/16px ui-monospace, SFMono-Regular, Menlo, monospace; width: 16px; text-align: center; border-radius: 3px; }
.esl-contents .on { background: #d7ecdd; color: #146c3a; }
.esl-contents .off { background: #f2f2f2; color: #c0c4cc; text-decoration: line-through; }
.esl-contents { align-items: center; }
.esl-contents span.main { width: 26px; font-size: 13px; line-height: 22px; border-radius: 4px; margin-right: 2px; }
.esl-contents span.main.off { background: #fde5e2; color: #b42318; text-decoration: line-through; }
/* Themes sometimes hyphenate table text ("ware-house"); keep words whole. */
.esl-app td, .esl-app th, .esl-dialog td { hyphens: manual !important; -webkit-hyphens: manual !important; word-break: normal; overflow-wrap: normal; }
.esl-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); font-size: 13px; margin: 2px 4px 2px 0; white-space: nowrap; }
button.esl-chip { cursor: pointer; }
button.esl-chip:hover:not(:disabled) { border-color: var(--accent); }
.esl-chip.reward { background: #fdf2e9; border-color: #f4cfae; }
.esl-chip.build { background: #eef4fd; border-color: #c4d6f3; }
.esl-chip.won, .esl-chip.mine { background: #dff3e6; border-color: #9fd5b1; font-weight: 600; }
.esl-chip.t1 { border-color: #e39b2c; }
.esl-chip.grey { opacity: .45; text-decoration: line-through; }
.esl-chip.broke { opacity: .6; border-style: dashed; }
.esl-chip i { font-style: normal; font-weight: 700; font-size: 11px; color: #9a6200; }
.esl-chip small { color: var(--muted); font-size: 11px; }
.esl-chip button { background: none; border: 0; padding: 0 0 0 2px; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); }
.esl-chip.gone { opacity: .5; }

/* Dialog */
.esl-dialog { width: min(720px, calc(100vw - 20px)); max-width: calc(100vw - 20px); max-height: calc(100vh - 30px); max-height: calc(100dvh - 30px); padding: 0; margin: auto; border: 0; border-radius: 12px; background: var(--bg); box-shadow: 0 24px 60px rgba(16, 24, 40, .3); overflow: hidden; }
.esl-dialog.wide { width: min(900px, calc(100vw - 20px)); }
.esl-dialog[open] { display: flex !important; flex-direction: column; }
/* Keep the window centred on screen whatever the theme does to <dialog>. */
dialog.esl-dialog { position: fixed !important; inset: 0 !important; margin: auto !important; padding: 0 !important; transform: none !important;
	height: auto !important; min-width: 0 !important; z-index: 100000; }
.esl-dialog::backdrop { background: rgba(16, 24, 40, .45); }
.esl-dlg-head { flex: none; display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.esl-dlg-head h2 { margin: 0; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.esl-dlg-head > div { min-width: 0; }
.esl-dlg-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.esl-x { flex: none; width: 34px; height: 34px; border: 0; background: none; font-size: 24px; cursor: pointer; border-radius: 6px; color: var(--muted); }
.esl-x:hover { background: var(--surface); }
.esl-dlg-body { padding: 6px 18px 16px; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.esl-dlg-foot { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface); }

/* Forms */
.esl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.esl-grid > h3, .esl-grid > .wide, .esl-field.wide { grid-column: 1 / -1; }
.esl-grid > h3 { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.esl-grid > h3:first-child { border-top: 0; padding-top: 0; }
.esl-field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-weight: 400; min-width: 0; }
.esl-field > span, .esl-lbl, .esl-loc-label { font-size: 13px; font-weight: 600; }
.esl-lbl { margin-right: 6px; }
.esl-field small { color: var(--muted); font-size: 12px; }
.esl-static { padding: 7px 0; font-weight: 700; }
.esl-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.esl-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; cursor: pointer; }
.esl-check input { width: 16px; height: 16px; margin: 0; }
.esl-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.esl-inline > input:not([type=checkbox]) { flex: 1 1 180px; width: auto; }
.esl-loc { display: flex; flex-direction: column; gap: 4px; }
.esl-loc-row { display: flex; flex-wrap: wrap; gap: 6px; }
.esl-loc-row select { flex: 0 1 auto; }
.esl-boxrow { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; padding: 10px; border: 1px dashed var(--border); border-radius: var(--r); }
.esl-people > div { padding: 5px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.esl-picker { display: inline-flex; flex-direction: column; gap: 4px; width: 100%; }
.esl-picker input { max-width: 260px; }
.esl-picker-list { display: flex; flex-wrap: wrap; align-items: center; }
.esl-note { margin: 0; padding: 8px 10px; background: var(--surface); border-radius: 6px; }
.esl-radio-list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; max-height: 360px; overflow: auto; }
.esl-radio { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-weight: 400; margin: 0; }
.esl-radio .esl-img { width: 40px; height: 30px; }
.esl-hist { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 8px; }
.esl-hist summary { cursor: pointer; font-weight: 600; }
.esl-hist ol { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.esl-hist li { padding: 5px 0; border-bottom: 1px dashed var(--border); }
.esl-hist li div { color: var(--muted); padding-left: 10px; }
.esl-errors { font-size: 13px; color: var(--danger); }

/* Assign */
.esl-groups { display: flex; flex-direction: column; gap: 10px; }
.esl-group { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.esl-group > header, .esl-offer-set > header { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--surface); }
.esl-group > header b, .esl-offer-set > header b { display: block; }
.esl-group > header small, .esl-offer-set > header small { color: var(--muted); }
.esl-copyrow { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); align-items: center; }
.esl-copyrow.clash { background: #fff1f0; box-shadow: inset 3px 0 0 var(--danger); }
.esl-copyrow.taken { background: #f6fbf7; }
.esl-copyinfo { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.esl-copyinfo .id, .esl-offer-copy .id { font-weight: 700; }
.esl-where { display: block; width: 100%; color: var(--muted); font-size: 12px; }
.esl-price { font-variant-numeric: tabular-nums; }
.esl-pickers { display: flex; flex-wrap: wrap; align-items: center; }
.esl-split { display: grid; grid-template-columns: 240px 1fr; gap: 14px; }
.esl-side { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow: auto; }
.esl-side button { text-align: left; border: 1px solid transparent; background: none; border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.esl-side button.on { background: #eef4fd; border-color: #c4d6f3; }
.esl-side small { display: block; color: var(--muted); font-size: 12px; }

/* Picking */
.esl-pickhead p { margin: 4px 0 10px; }
.esl-mypicks { position: sticky; top: 0; z-index: 2; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 10px; margin-bottom: 12px; box-shadow: 0 4px 12px rgba(16,24,40,.06); }
.esl-tier { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 3px 0; }
.esl-tier > b { min-width: 52px; }
.esl-tier.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; }
.esl-offer { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.esl-offer-set { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.esl-offer-copy { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-top: 1px solid var(--border); font-size: 13.5px; }
.esl-offer-copy small { display: block; color: var(--muted); font-size: 12px; }
.esl-offer-copy.mine { background: #f2faf4; }
.esl-tierpick { display: flex; flex-wrap: wrap; gap: 8px; }
.esl-tierpick .esl-btn { min-width: 86px; flex-direction: column; }

/* Setup */
.esl-card { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; background: var(--bg); }
.esl-card h3 { margin-top: 0; }
.esl-title-input { font-weight: 700; font-size: 16px; max-width: 320px; }
.esl-app .esl-inline .esl-title-input { flex: 0 1 320px; }
.esl-bins { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.esl-bin { display: inline-flex; align-items: center; gap: 4px; font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 4px 3px 8px; border: 1px dashed #98a2b3; border-radius: 5px; }
.esl-bin small { color: var(--muted); font-weight: 400; }
.esl-bin button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 3px; }
.esl-app .esl-cell-input { min-height: 30px; padding: 3px 6px; border-color: transparent; background: transparent; }
.esl-app .esl-cell-input:hover { border-color: var(--border); }
.esl-app .esl-cell-input.num { text-align: right; max-width: 110px; }

/* Toast */
.esl-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1b1f24; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100000; max-width: min(600px, calc(100vw - 30px)); font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.esl-toast.bad { background: var(--danger); }
.esl-locked { padding: 18px; border: 1px solid #dcdfe5; border-radius: 8px; background: #f5f6f8; }
.esl-in-admin { margin-top: 12px; }

/* Phones */
@media (max-width: 760px) {
	.esl-grid { grid-template-columns: 1fr; }
	.esl-toolbar > select { flex: 1 1 45%; }
	.esl-nav a { padding: 8px 9px; }
	.esl-user { display: none; }
	.esl-copyrow { grid-template-columns: 1fr; }
	.esl-split { grid-template-columns: 1fr; }
	.esl-side { flex-direction: row; overflow-x: auto; max-height: none; }
	.esl-side button { flex: 0 0 auto; }
	.esl-offer { grid-template-columns: 1fr; }
	.esl-stock thead { display: none; }
	.esl-stock, .esl-stock tbody { display: block; }
	.esl-stock tbody tr { display: grid; grid-template-columns: 26px 52px 1fr auto; grid-template-areas: "cb img set price" "cb img status status" "cb img loc loc" "cb img box box" "cb img who who"; gap: 2px 8px; padding: 8px; border-bottom: 1px solid var(--border); }
	.esl-stock tbody td { padding: 0; border: 0; }
	.esl-stock td.esl-cb { grid-area: cb; } .esl-stock td.img { grid-area: img; } .esl-stock td.setcell { grid-area: set; }
	.esl-stock td.id { display: none; }
	.esl-stock td:nth-child(5) { grid-area: status; } .esl-stock td:nth-child(6) { grid-area: loc; font-size: 13px; }
	.esl-stock td:nth-child(7) { grid-area: box; font-size: 13px; color: var(--muted); } .esl-stock td:nth-child(7)::before { content: "Box: "; }
	.esl-stock td:nth-child(8) { display: none; } .esl-stock td:nth-child(9) { grid-area: price; } .esl-stock td:nth-child(10) { grid-area: who; }
	.esl-mypicks { position: static; }
}

/* Club page: hide common theme sidebars (the app also detects others itself). */
body.estlug-sets-page #secondary, body.estlug-sets-page aside#sidebar, body.estlug-sets-page .sidebar,
body.estlug-sets-page aside.widget-area, body.estlug-sets-page [role=complementary] { display: none !important; }
body.estlug-sets-page #primary, body.estlug-sets-page .content-area { width: 100% !important; max-width: 100% !important; flex: 1 1 100% !important; }
