/* KSKWN Aktionstool – upload widget. Minimal; inherits font/colours from the theme. */
.kskwn-at-upload [hidden],
.kskwn-at-upload-wait[hidden] {
	display: none !important;
}

.kskwn-at-upload {
	display: block;
	margin: .25em 0 1em;
	--kskwn-at-accent: currentColor;
	--kskwn-at-ok: #1f7a3a;
	--kskwn-at-error: #b3261e;
}

.kskwn-at-upload__drop {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .25em;
	min-height: 7em;
	padding: 1.25em 1em;
	border: 2px dashed rgba(0, 0, 0, .3);
	border-radius: 6px;
	background: rgba(0, 0, 0, .02);
	text-align: center;
	cursor: pointer;
	transition: border-color .15s, background-color .15s;
}

.kskwn-at-upload__drop:hover,
.kskwn-at-upload__drop.is-dragover {
	border-color: rgba(0, 0, 0, .6);
	background: rgba(0, 0, 0, .05);
}

.kskwn-at-upload__drop:focus-within {
	outline: 3px solid Highlight;
	outline: 3px solid -webkit-focus-ring-color;
	outline-offset: 2px;
}

/* The real file input covers the drop zone (native click/tap → picker, label + keyboard work). */
.kskwn-at-upload__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
	font-size: 0;
}

/* Without JS the input stays visible and usable for nothing – hide the fancy parts only when ready. */
.kskwn-at-upload:not(.is-ready) .kskwn-at-upload__input {
	position: static;
	opacity: 1;
	font-size: inherit;
}

.kskwn-at-upload__icon {
	width: 2em;
	height: 2em;
	background: currentColor;
	opacity: .55;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 15v4H5v-4H3v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4h-2zM11 5.8V16h2V5.8l3.6 3.6L18 8l-6-6-6 6 1.4 1.4L11 5.8z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 15v4H5v-4H3v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4h-2zM11 5.8V16h2V5.8l3.6 3.6L18 8l-6-6-6 6 1.4 1.4L11 5.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.kskwn-at-upload__button {
	font-weight: 700;
	text-decoration: underline;
}

.kskwn-at-upload__hint {
	font-size: .85em;
	opacity: .75;
}

.kskwn-at-upload.is-full .kskwn-at-upload__drop {
	opacity: .5;
	cursor: not-allowed;
}

.kskwn-at-upload__note {
	display: block;
	margin-top: .4em;
	color: var(--kskwn-at-error);
	font-size: .9em;
}

.kskwn-at-upload__list {
	display: block;
	list-style: none;
	margin: .5em 0 0;
	padding: 0;
}

.kskwn-at-file {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: .25em .75em;
	align-items: center;
	margin: 0 0 .5em;
	padding: .6em .75em;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 6px;
	background: rgba(255, 255, 255, .6);
}

.kskwn-at-file__head {
	display: flex;
	flex-wrap: wrap;
	gap: .1em .75em;
	min-width: 0;
}

.kskwn-at-file__name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.kskwn-at-file__meta {
	font-size: .85em;
	opacity: .75;
	font-variant-numeric: tabular-nums;
}

.kskwn-at-file__actions {
	grid-column: 2;
	grid-row: 1 / span 3;
	display: flex;
	gap: .5em;
	align-self: center;
}

.kskwn-at-file__bar {
	grid-column: 1;
	width: 100%;
	height: .5em;
	accent-color: var(--kskwn-at-accent);
}

.kskwn-at-file__msg {
	grid-column: 1;
	font-size: .9em;
}

.kskwn-at-file__msg:empty {
	display: none;
}

.kskwn-at-file__remove,
.kskwn-at-file__retry {
	padding: .3em .7em;
	font: inherit;
	font-size: .85em;
	line-height: 1.3;
	cursor: pointer;
	white-space: nowrap;
	min-height: 2.2em;
}

.kskwn-at-file.is-done {
	border-color: var(--kskwn-at-ok);
}

.kskwn-at-file.is-done .kskwn-at-file__bar {
	display: none;
}

.kskwn-at-file.is-done .kskwn-at-file__name::before {
	content: "\2713\00a0";
	color: var(--kskwn-at-ok);
}

.kskwn-at-file.is-error {
	border-color: var(--kskwn-at-error);
}

.kskwn-at-file.is-error .kskwn-at-file__msg,
.kskwn-at-file.is-offline .kskwn-at-file__msg {
	color: var(--kskwn-at-error);
}

.kskwn-at-upload__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.kskwn-at-upload-wait {
	display: block;
	margin: .5em 0;
	font-size: .9em;
}

.kskwn-at-busy [type="submit"][aria-disabled="true"] {
	cursor: progress;
	opacity: .6;
}
