/* ---- Wrapper ---- */
.dm-list-wrap { margin: 1em 0; font-size: 0.875rem; line-height: 1.5; color: inherit; }

/* ---- Toolbar ---- */
.dm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.dm-search-wrap { flex: 1 1 260px; min-width: 200px; }
.dm-filter-wrap { flex: 0 0 auto; }
.dm-search, .dm-cat-filter { width: 100%; padding: 8px 12px; border: 1px solid #d8dadc; border-radius: 4px; font: inherit; background: #fff; box-sizing: border-box; }
.dm-search:focus, .dm-cat-filter:focus { outline: none; border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; }

/* ---- Table ---- */
.dm-table { width: 100%; border-collapse: collapse; font-size: 1em; }
.dm-table thead th { text-align: left; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid #d8dadc; color: #50575e; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.04em; }
.dm-table tbody td { padding: 12px; border-bottom: 1px solid #ececec; vertical-align: middle; }
.dm-table tbody tr:last-child td { border-bottom: 0; }
.dm-table tbody tr:hover { background: #fafafa; }

.dm-cell-num { text-align: right; white-space: nowrap; }
.dm-cell-action { text-align: right; white-space: nowrap; width: 1%; }

/* ---- Sort ---- */
.dm-sortable { cursor: pointer; user-select: none; position: relative; }
.dm-sortable:hover { color: #1d2327; }
.dm-sortable span::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle; opacity: 0; }
.dm-sortable.dm-sort-asc span::after { border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 5px solid currentColor; opacity: 1; }
.dm-sortable.dm-sort-desc span::after { border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 1; }

/* ---- Name cell ---- */
.dm-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dm-name-title { font-weight: 600; color: #1d2327; }
.dm-name-desc { color: #646970; font-size: 0.9em; margin-top: 4px; }
.dm-tag { display: inline-block; font-size: 0.7em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 10px; border: 1px solid currentColor; line-height: 1.5; }
.dm-tag-lock { color: #996800; }
.dm-tag-form { color: #2271b1; }
.dm-muted { color: #999; }

/* ---- Button ---- */
.dm-button { display: inline-block; background: #2271b1; color: #fff; padding: 6px 14px; border-radius: 4px; text-decoration: none; border: 0; cursor: pointer; font: inherit; font-size: 0.9em; line-height: 1.4; }
.dm-button:hover, .dm-button:focus { background: #135e96; color: #fff; text-decoration: none; }

/* ---- Empty / no results ---- */
.dm-empty, .dm-no-results { color: #646970; font-style: italic; padding: 12px 0; text-align: center; }

/* ---- Gate / form / success ---- */
.dm-gate, .dm-form-wrap, .dm-success {
	margin: 1em 0;
	padding: 18px;
	background: #fff;
	border: 1px solid #e3e3e3;
	border-radius: 6px;
	font-size: 0.875rem;
	line-height: 1.5;
}
.dm-gate h3, .dm-form-wrap h3, .dm-success h3 { font-size: 1.05em; margin: 0 0 12px; }
.dm-form-intro { font-size: 0.95em; margin-bottom: 12px; color: #50575e; }
.dm-error, .dm-error-list { color: #b32d2e; }
.dm-error-list ul { margin: 0; padding-left: 20px; }
.dm-required { color: #b32d2e; }
.dm-download-form p { margin: 0 0 12px; }
.dm-download-form label { font-weight: 600; display: block; }
.dm-download-form input[type="text"],
.dm-download-form input[type="email"],
.dm-download-form input[type="tel"],
.dm-download-form input[type="password"],
.dm-download-form select,
.dm-download-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 7px 10px;
	border: 1px solid #d8dadc;
	border-radius: 4px;
	font: inherit;
	margin-top: 4px;
}
.dm-download-form input:focus,
.dm-download-form select:focus,
.dm-download-form textarea:focus { outline: none; border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; }
.dm-radio { display: inline-flex; align-items: center; margin-right: 12px; font-weight: 400; }
.dm-back-link { color: #2271b1; text-decoration: none; font-size: 0.9em; }
.dm-back-link:hover, .dm-back-link:focus { text-decoration: underline; }
.dm-form-wrap .dm-back { margin: 0 0 12px; }
.dm-success .dm-back-link { margin-left: 12px; }
.dm-gate-form input[type="password"] {
	width: 100%; box-sizing: border-box; padding: 7px 10px;
	border: 1px solid #d8dadc; border-radius: 4px; font: inherit;
}

/* ---- Tablet: tighten cells ---- */
@media (max-width: 880px) {
	.dm-table tbody td { padding: 10px 8px; }
	.dm-table thead th { padding: 8px; }
	.dm-name-desc { font-size: 0.85em; }
}

/* ---- Mobile: card-style rows ---- */
@media (max-width: 640px) {
	.dm-toolbar { flex-direction: column; align-items: stretch; }
	.dm-search-wrap, .dm-filter-wrap { flex: 1 1 auto; }

	.dm-table { display: block; border: 0; }
	.dm-table thead { display: none; }
	.dm-table tbody { display: block; }
	.dm-table tbody tr {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 6px 0;
		padding: 14px;
		border: 1px solid #e3e3e3;
		border-radius: 8px;
		margin-bottom: 10px;
	}
	.dm-table tbody tr:hover { background: transparent; }
	.dm-table tbody tr:last-child { margin-bottom: 0; }
	.dm-table tbody td { padding: 0; border: 0; }

	.dm-cell-name { flex: 1 1 100%; }
	.dm-cell-category, .dm-cell-size, .dm-cell-date {
		flex: 0 0 auto;
		color: #646970;
		font-size: 0.88em;
		white-space: nowrap;
	}
	.dm-cell-num { text-align: left; }
	.dm-cell-category::after, .dm-cell-size::after {
		content: '•';
		margin: 0 8px;
		color: #c0c0c0;
	}
	.dm-cell-action { flex: 1 1 100%; text-align: right; margin-top: 8px; }
	.dm-cell-action .dm-button { padding: 8px 18px; font-size: 0.95em; }
	.dm-name-desc { margin-top: 6px; }
}

/* ---- Very narrow: stack download button full width ---- */
@media (max-width: 380px) {
	.dm-cell-action { text-align: stretch; }
	.dm-cell-action .dm-button { display: block; text-align: center; }
}
