:root{
  --bg:#0b0c10;
  --panel:rgba(255,255,255,.06);
  --panel2:rgba(255,255,255,.09);
  --text:rgba(255,255,255,.88);
  --muted:rgba(255,255,255,.62);
  --border:rgba(255,255,255,.12);
  --shadow:0 12px 40px rgba(0,0,0,.45);
  --radius:18px;
  --radius2:14px;
  --gap:14px;
  --focus:rgba(120,180,255,.35);
}
@media (prefers-color-scheme: light){
  :root{
    --bg:#f6f7fb;
    --panel:rgba(0,0,0,.05);
    --panel2:rgba(0,0,0,.08);
    --text:rgba(0,0,0,.88);
    --muted:rgba(0,0,0,.62);
    --border:rgba(0,0,0,.12);
    --shadow:0 12px 36px rgba(0,0,0,.12);
    --focus:rgba(0,120,255,.22);
  }
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Noto Sans",Arial;
  background:
    radial-gradient(1200px 700px at 10% 0%, rgba(120,180,255,.18), transparent 55%),
    radial-gradient(900px 600px at 90% 10%, rgba(255,120,200,.14), transparent 55%),
    var(--bg);
  color:var(--text);
}
a{color:inherit;text-decoration:none}
.container{max-width:1220px;margin:0 auto;padding:18px}

.topbar{
  position:sticky;top:0;z-index:20;
  backdrop-filter:blur(10px);
  background:linear-gradient(to bottom, rgba(0,0,0,.22), rgba(0,0,0,0));
  border-bottom:1px solid var(--border);
}
@media (prefers-color-scheme: light){
  .topbar{background:linear-gradient(to bottom, rgba(255,255,255,.75), rgba(255,255,255,0))}
}

.header{
  display:flex;align-items:center;justify-content:space-between;
  gap:14px;padding:14px 0;
}
.brand{display:flex;align-items:center;gap:10px;min-width:210px}
.brand h1{font-size:16px;margin:0;line-height:1.1;letter-spacing:.2px}
.brand p{margin:0;font-size:12px;color:var(--muted)}

.controls{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;flex:1}
.input,.select{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel);
  min-height:40px;
  box-shadow:0 6px 18px rgba(0,0,0,.12);
}
.input input{all:unset;width:min(540px,52vw)}
.select select{all:unset;cursor:pointer;padding-right:18px}
.input:focus-within,.select:focus-within{outline:3px solid var(--focus);outline-offset:2px}

.layout{display:grid;grid-template-columns:330px 1fr;gap:16px;padding:16px 0 26px}
@media (max-width:980px){.layout{grid-template-columns:1fr}}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.card .hd{
  padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:10px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(to bottom, var(--panel2), transparent);
}
.card .hd h2{font-size:14px;margin:0;letter-spacing:.2px}
.card .bd{padding:14px 16px}

.vendorList{display:flex;flex-direction:column;gap:10px}
.vendor{
  border:1px solid var(--border);
  border-radius:var(--radius2);
  background:rgba(255,255,255,.03);
  overflow:hidden;
}
.vendor summary{
  list-style:none;cursor:pointer;padding:12px 12px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  user-select:none;
}
.vendor summary::-webkit-details-marker{display:none}
.vendor summary .name{font-weight:650;font-size:13px}
.vendor summary .count{color:var(--muted);font-size:12px}
.vendor .items{padding:10px 10px 12px;display:grid;grid-template-columns:1fr;gap:8px}

.boxBtn{
  display:flex;align-items:center;gap:10px;
  padding:10px 10px;border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  transition:transform .12s ease, background .12s ease;
}
.boxBtn:hover{transform:translateY(-1px);background:rgba(255,255,255,.07)}
.thumb{
  width:42px;height:32px;border-radius:10px;
  background:rgba(255,255,255,.07);
  border:1px solid var(--border);
  overflow:hidden;display:grid;place-items:center;
  flex:0 0 auto;
}
.thumb img{width:100%;height:100%;object-fit:contain;display:block;padding:2px}
.boxMeta{display:flex;flex-direction:column;gap:2px;min-width:0}
.boxMeta .title{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.boxMeta .sub{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.mainTop{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.breadcrumb{font-size:12px;color:var(--muted)}
.badge{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 10px;border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  font-size:12px;color:var(--muted);
}

.grid{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:12px}
@media (max-width:720px){.grid{grid-template-columns:1fr}}

.fileRow{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px;border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
}
.fileName{min-width:0;display:flex;flex-direction:column;gap:2px}
.fileName strong{font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.fileName span{font-size:12px;color:var(--muted)}
.actions{gap:10px;display:flex;gap:8px;flex:0 0 auto}
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 12px;border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  font-size:12px;color:var(--text);
  cursor:pointer;
  transition:transform .12s ease, background .12s ease;
  white-space:nowrap;
}
.btn:hover{transform:translateY(-1px);background:rgba(255,255,255,.09)}
.btn:active{transform:translateY(0)}

.empty{
  padding:18px;border-radius:14px;
  border:1px dashed var(--border);
  color:var(--muted);
  background:rgba(255,255,255,.03);
}

.footer{padding:18px 0 30px;color:var(--muted);font-size:12px}
code{padding:2px 6px;border-radius:8px;background:rgba(255,255,255,.06);border:1px solid var(--border)}


/* Better native <select> styling (consistent pill look) */
.select{
  position: relative;
}
.select select{
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
  background: transparent;
  border: 0;
  color: inherit;
  width: 100%;
  padding-right: 26px;
  font: inherit;
}
.select::after{
  content:"▾";
  position:absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events:none;
  font-size: 12px;
}


.fileRow{
  gap: 12px;
}
.actions{gap:10px;
  align-self: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 520px){
  .fileRow{
    flex-direction: column;
    align-items: stretch;
  }
  .actions{gap:10px;
    align-self: stretch;
    justify-content: flex-start;
  }
}


/* OpenATV branding */
.brandLogo{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.brandWord{
  height: 44px;
  width: auto;
  display:block;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,.22));
}
@media (max-width: 520px){
  .brandWord{display:none;}
}


/* Compact select pills (Version + Vendor) */
.select.compact{
  min-width: 150px;
}
.select.compact select{
  width: auto;
  min-width: 110px;
}


/* Force vendor/version selects to render like pills across browsers */
.select.compact{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel);
  min-height:40px;
  box-shadow:0 6px 18px rgba(0,0,0,.12);
}
.select.compact select{
  display:block;
  background:transparent;
  border:0;
  outline:0;
  color:inherit;
  font:inherit;
  padding:0;
  margin:0;
  min-width: 90px;
}
select#vendorFilter, select#versionSelect{
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
}


/* Hard override: make native selects visually disappear inside pill */
.select.compact{
  overflow: hidden;
}
.select.compact select{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
select#vendorFilter, select#versionSelect{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
}


/* Strong pill styling for selects (Version + Vendor) */
.select.compact{
  border: 1px solid var(--border) !important;
  background: var(--panel) !important;
  border-radius: 999px !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.12) !important;
  padding: 10px 12px !important;
  min-height: 40px !important;
}
.select.compact:focus-within{
  outline: 3px solid var(--focus) !important;
  outline-offset: 2px !important;
}

/* Mobile header/layout cleanup */
@media (max-width: 900px){
  .header{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand{
    min-width: 0;
    width: 100%;
  }

  .brand > div:last-child{
    min-width: 0;
  }

  .brand h1{
    font-size: 18px;
    line-height: 1.15;
    margin-bottom: 4px;
  }

  .brand p{
    font-size: 13px;
    line-height: 1.25;
  }

  .controls{
    width: 100%;
    justify-content: stretch;
    gap: 10px;
  }

  .controls .input{
    width: 100%;
  }

  .controls .input input{
    width: 100%;
    min-width: 0;
  }

  .controls .select.compact{
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .controls .select.compact select{
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 700px){
  .container{
    padding: 12px;
  }

  .topbar{
    position: relative;
  }

  .brand{
    display: block;
  }

  .brandLogo,
  .brandLogoLink{
    display: none !important;
  }

  .brand h1{
    font-size: 17px;
  }

  .brand p{
    font-size: 12px;
    max-width: 100%;
  }

  .controls{
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .controls .input,
  .controls .select.compact{
    width: 100%;
    min-width: 0;
  }

  .controls .select.compact{
    flex: none;
  }

  .layout{
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 12px;
  }

  .card .hd{
    padding: 12px 14px;
  }

  .card .bd{
    padding: 12px 14px;
  }

  .mainTop{
    flex-direction: column;
    align-items: stretch;
  }

  .mainTop .input{
    width: 100%;
    min-width: 0 !important;
  }

  .fileRow{
    flex-direction: column;
    align-items: stretch;
  }

  .actions{
    align-self: stretch;
    justify-content: flex-start;
  }
}

.footer{
	padding: 18px 0 30px;
}

.footerLinks{
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: center;
	padding: 16px;
	border-radius: 22px;
	border: 1px solid rgba(255,255,255,.18);
	background: rgba(15,20,32,.42);
	backdrop-filter: blur(14px);
	box-shadow: 0 18px 50px rgba(0,0,0,.22);
}

.footerLink{
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 11px 16px;
	border-radius: 999px;
	border: 1px solid rgba(255,255,255,.16);
	background: rgba(255,255,255,.16);
	color: #ffffff;
	text-decoration: none;
	transition: transform .12s ease, background .12s ease, border-color .12s ease;
	min-height: 44px;
	box-shadow: 0 8px 24px rgba(0,0,0,.16);
}

.footerLink:hover{
	transform: translateY(-1px);
	background: rgba(255,255,255,.24);
	border-color: rgba(255,255,255,.28);
}

.footerLinkIcon{
	width: 12px;
	height: 12px;
	border-radius: 999px;
	flex: 0 0 auto;
	box-shadow: 0 0 0 4px rgba(255,255,255,.10);
}

.footerLinkText{
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	color: #ffffff;
	text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* Types */
.footerLink--video .footerLinkIcon{
	background: linear-gradient(135deg, #ff7a59, #ffb36a);
}

.footerLink--git .footerLinkIcon{
	background: linear-gradient(135deg, #67a8ff, #8e7dff);
}

.footerLink--status .footerLinkIcon{
	background: linear-gradient(135deg, #57d67a, #97e85b);
}

@media (max-width: 700px){
	.footerLinks{
		flex-direction: column;
		align-items: stretch;
		padding: 14px;
	}

	.footerLink{
		justify-content: center;
	}
}

@media (prefers-color-scheme: light){
	.footerLinks{
		border: 1px solid rgba(255,255,255,.38);
		background: rgba(255,255,255,.28);
		backdrop-filter: blur(18px) saturate(140%);
		-webkit-backdrop-filter: blur(18px) saturate(140%);
		box-shadow:
			0 18px 40px rgba(0,0,0,.08),
			inset 0 1px 0 rgba(255,255,255,.30);
	}

	.footerLink{
		border: 1px solid rgba(255,255,255,.42);
		background: rgba(255,255,255,.34);
		backdrop-filter: blur(14px) saturate(140%);
		-webkit-backdrop-filter: blur(14px) saturate(140%);
		color: rgba(0,0,0,.82);
		box-shadow:
			0 8px 20px rgba(0,0,0,.06),
			inset 0 1px 0 rgba(255,255,255,.34);
	}

	.footerLink:hover{
		background: rgba(255,255,255,.46);
		border-color: rgba(255,255,255,.55);
	}

	.footerLinkText{
		color: rgba(0,0,0,.82);
		text-shadow: none;
	}
}

.donateSelect{
	padding: 0 !important;
	overflow: hidden;
}

.donateForm{
	margin: 0;
	width: 100%;
}

.donateBtn{
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	width: 100% !important;
	height: 40px !important;
	padding: 0 14px !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--text) !important;
	font: inherit !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	cursor: pointer !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
}

.donateBtn:hover{
	background: rgba(255,255,255,.06) !important;
}

.donateIcon{
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 16px !important;
	height: 16px !important;
	border-radius: 999px !important;
	background: linear-gradient(135deg, #ff7c7c, #ffb36a) !important;
	color: #fff !important;
	font-size: 9px !important;
	line-height: 1 !important;
	flex: 0 0 auto !important;
}

.donateText{
	font-size: 13px !important;
	font-weight: 600 !important;
	white-space: nowrap !important;
}

select#versionSelect,
select#vendorFilter,
.select.compact select{
	color-scheme: dark;
	background: transparent !important;
	color: var(--text) !important;
}

.customSelect{
	position: relative;
	display: flex;
	align-items: center;
	min-height: 40px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--panel);
	box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.customSelectTrigger{
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	height: 40px;
	padding: 0 14px;
	border: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	cursor: pointer;
	border-radius: 999px;
}

.customSelectTrigger:focus-visible{
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.customSelectLead{
	flex: 0 0 auto;
}

.customSelectValue{
	flex: 1 1 auto;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.customSelectArrow{
	flex: 0 0 auto;
	color: var(--muted);
	font-size: 12px;
}

.customSelectMenu{
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 8px;
	border-radius: 18px;
	border: 1px solid var(--border);
	background: rgba(20,24,36,.96);
	backdrop-filter: blur(12px);
	box-shadow: 0 18px 50px rgba(0,0,0,.28);
	max-height: min(340px, 60vh);
	overflow: auto;
}

.customSelectMenu[hidden]{
	display: none !important;
}

@media (prefers-color-scheme: light){
	.customSelectMenu{
		background: rgba(255,255,255,.96);
	}
}

.customSelectOption{
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 40px;
	padding: 10px 12px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.customSelectOption:hover{
	background: rgba(255,255,255,.08);
}

@media (prefers-color-scheme: light){
	.customSelectOption:hover{
		background: rgba(0,0,0,.06);
	}
}

.customSelectOption.is-selected{
	background: rgba(120,180,255,.16);
}

.customSelect.is-open .customSelectArrow{
	transform: rotate(180deg);
}

.customSelect.is-open .customSelectTrigger{
	background: rgba(255,255,255,.04);
}

@media (max-width: 700px){
	.customSelect{
		width: 100%;
	}
}

/* Android / Mobile header fix */
@media (max-width: 700px){
	.topbar{
		position: relative;
	}

	.container{
		padding: 12px;
	}

	.header{
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 10px 0;
	}

	.brand{
		display: block;
		width: 100%;
		min-width: 0;
	}

	.brandLogo,
	.brandLogoLink{
		display: none !important;
	}

	.brand h1{
		font-size: 17px;
		line-height: 1.15;
		margin: 0 0 4px;
	}

	.brand p{
		font-size: 12px;
		line-height: 1.25;
		margin: 0;
		max-width: 100%;
	}

	.controls{
		display: grid !important;
		grid-template-columns: 1fr !important;
		gap: 10px !important;
		width: 100%;
		justify-content: stretch !important;
	}

	.controls > *{
		width: 100%;
		min-width: 0;
	}

	.controls .input{
		width: 100%;
		min-width: 0;
	}

	.controls .input input{
		width: 100% !important;
		min-width: 0 !important;
	}

	.select.compact,
	.customSelect.compact,
	.donateSelect{
		width: 100% !important;
		min-width: 0 !important;
	}

	.customSelectTrigger,
	.donateBtn{
		width: 100% !important;
		justify-content: flex-start !important;
	}

	.donateForm{
		width: 100%;
	}

	.layout{
		grid-template-columns: 1fr !important;
		gap: 12px;
		padding-top: 12px;
	}

	.card .hd{
		padding: 12px 14px;
	}

	.card .bd{
		padding: 12px 14px;
	}
}

@media (max-width: 900px) and (pointer: coarse) {
	.topbar{
		position: relative;
	}

	.container{
		padding: 12px;
	}

	.header{
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 10px 0;
	}

	.brand{
		display: block;
		width: 100%;
		min-width: 0;
	}

	.brandLogo,
	.brandLogoLink{
		display: none !important;
	}

	.brand h1{
		font-size: 17px;
		line-height: 1.15;
		margin: 0 0 4px;
	}

	.brand p{
		font-size: 12px;
		line-height: 1.25;
		margin: 0;
		max-width: 100%;
	}

	.controls{
		display: grid !important;
		grid-template-columns: 1fr !important;
		gap: 10px !important;
		width: 100%;
		justify-content: stretch !important;
	}

	.controls > *{
		width: 100%;
		min-width: 0;
	}

	.controls .input{
		width: 100%;
		min-width: 0;
	}

	.controls .input input{
		width: 100% !important;
		min-width: 0 !important;
	}

	.select.compact,
	.customSelect.compact,
	.donateSelect{
		width: 100% !important;
		min-width: 0 !important;
	}

	.customSelectTrigger,
	.donateBtn{
		width: 100% !important;
		justify-content: flex-start !important;
	}

	.donateForm{
		width: 100%;
	}

	.layout{
		grid-template-columns: 1fr !important;
		gap: 12px;
		padding-top: 12px;
	}

	.card .hd{
		padding: 12px 14px;
	}

	.card .bd{
		padding: 12px 14px;
	}
}

/* Chrome Android specific hardening */
html{
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body{
	overflow-x: hidden !important;
}

@media (max-width: 900px) and (pointer: coarse){
	html, body{
		max-width: 100%;
		overflow-x: hidden !important;
	}

	.topbar,
	.container,
	.header,
	.controls,
	.layout,
	.card,
	.input,
	.select,
	.customSelect{
		max-width: 100% !important;
	}

	.input,
	.select,
	.customSelect,
	.customSelectTrigger{
		box-sizing: border-box !important;
	}

	.controls{
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.controls > *{
		min-width: 0 !important;
		max-width: 100% !important;
	}

	.input input,
	.customSelectValue{
		min-width: 0 !important;
	}

	/* Chrome sometimes renders blur/filters badly in tight mobile layouts */
	.topbar,
	.card,
	.input,
	.select,
	.customSelect,
	.footerLinks{
		backdrop-filter: none !important;
		-webkit-backdrop-filter: none !important;
	}

	/* Prevent oversized menus */
	.customSelectMenu{
		width: 100% !important;
		max-width: 100% !important;
		left: 0 !important;
		right: 0 !important;
	}
}

@media (min-width: 981px){
	.layout{
		align-items: start;
	}

	.layout > .card:first-child{
		position: sticky;
		top: 86px;
		height: calc(100vh - 110px);
		overflow: hidden;
	}

	.layout > .card:first-child .bd{
		height: calc(100% - 52px);
		overflow-y: auto;
		overflow-x: hidden;
	}

	.layout > main.card{
		align-self: start;
	}
}