#download-dialog {
	box-sizing: border-box;
	width: min(420px, calc(100vw - 32px));
	max-height: 80vh;
	margin: auto;
	padding: 24px;
	border: 1px solid #ac803e;
	border-radius: 12px;
	background: #201712;
	color: #f3d48e;
	font-size: 16px;
}
#download-dialog::backdrop { background: rgba(0, 0, 0, .65); }
#download-dialog h2 { margin: 0 0 20px; font-size: 20px; }
#download-dialog .download-options { display: grid; gap: 12px; }
#download-dialog .download-options a {
	display: block;
	padding: 16px;
	border: 1px solid #80602e;
	border-radius: 8px;
	color: #f3d48e;
	text-align: center;
	overflow-wrap: anywhere;
}
#download-dialog .download-options a:hover,
#download-dialog .download-options a:focus-visible { background: #33241b; }
#download-dialog a:focus-visible,
#download-dialog button:focus-visible { outline: 2px solid #f3d48e; outline-offset: 3px; }
#download-dialog form { margin-top: 20px; text-align: right; }
#download-dialog button {
	padding: 8px 16px;
	border: 1px solid #ac803e;
	border-radius: 6px;
	background: #33241b;
	color: #f3d48e;
	font: inherit;
	cursor: pointer;
}


.site-message { padding: 16px; color: #f3d48e; background: #201712; font-size: 16px; text-align: center; }
.site-message button { color: inherit; background: none; border: 1px solid #ac803e; border-radius: 4px; padding: 6px 12px; cursor: pointer; }

.line-retry { display: block; margin: 0 auto 12px; padding: 6px 12px; border: 1px solid #ac803e; border-radius: 4px; color: #f3d48e; background: #201712; font-size: 14px; cursor: pointer; }
.line-retry:disabled { opacity: .6; cursor: wait; }
.thcom[aria-disabled="true"] { opacity: .5; pointer-events: none; }
#main a:focus-visible, .line-retry:focus-visible { outline: 2px solid #ac803e; outline-offset: 2px; }

.star-theme :is(#download-dialog, .site-message) { background: #fff; color: #2a3990; border-color: #ccc; }
.star-theme #download-dialog .download-options a { color: #2a3990; border-color: #838dbf; }
.star-theme #download-dialog .download-options a:hover,
.star-theme #download-dialog .download-options a:focus-visible { background: #edf2f8; }
.star-theme :is(.line-retry, .site-message button, #download-dialog button) { color: #fff; background: linear-gradient(0deg, #293790, #3042ba); border-color: #3042ba; }
.star-theme :is(#main a, .line-retry, #download-dialog a, #download-dialog button):focus-visible { outline-color: #3042ba; }

#main .navi > li .jsBox {
	max-height: calc(100vh - 6rem);
	max-height: calc(100dvh - 6rem);
	overflow-y: auto;
	overscroll-behavior: contain;
}
