/* TangoDestiny US Tango Events. All rules are scoped to .tdue so the theme is untouched. */
.tdue {
	--tdue-ink: #1f1a17;
	--tdue-muted: #6b625c;
	--tdue-line: #e6ddd3;
	--tdue-paper: #fbf8f4;
	--tdue-card: #ffffff;
	--tdue-accent: #9e1b32;
	--tdue-accent-ink: #ffffff;
	--tdue-festival: #9e1b32;
	--tdue-marathon: #1f4a73;
	--tdue-encuentro: #2e6048;
	--tdue-milonga: #8a5a12;
	--tdue-radius: 10px;
	color: var(--tdue-ink);
	max-width: 1040px;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.5;
}
.tdue *, .tdue *::before, .tdue *::after { box-sizing: border-box; }
.tdue-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tdue-muted { color: var(--tdue-muted); }
.tdue-loading { color: var(--tdue-muted); padding: 2rem 0; }

/* Header */
.tdue-head { margin: 0 0 1.25rem; }
.tdue .tdue-title { font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.15; margin: 0 0 .4rem; letter-spacing: -.01em; }
.tdue-sub { margin: 0 0 .5rem; color: var(--tdue-muted); }
.tdue-status { margin: 0; font-size: .875rem; color: var(--tdue-muted); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.tdue-dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; background: #b5aca4; }
.tdue-dot--success { background: #2e7d4f; }
.tdue-dot--partial { background: #c98a12; }
.tdue-dot--failed { background: #b3261e; }

/* Search */
.tdue-search { position: relative; margin-bottom: .9rem; }
.tdue-search-icon { position: absolute; left: .95rem; top: 50%; width: 1.15rem; height: 1.15rem; transform: translateY(-50%); fill: none; stroke: var(--tdue-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.tdue .tdue-search input {
	width: 100%; height: 3.1rem; padding: 0 1rem 0 2.75rem; font-size: 1.05rem;
	border: 1.5px solid var(--tdue-line); border-radius: var(--tdue-radius); background: var(--tdue-card); color: var(--tdue-ink);
	box-shadow: 0 1px 2px rgba(31, 26, 23, .04);
}
.tdue .tdue-search input:focus { outline: none; border-color: var(--tdue-accent); box-shadow: 0 0 0 3px rgba(158, 27, 50, .14); }

/* Filters */
.tdue-filters {
	display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: flex-end;
	padding: 1rem; background: var(--tdue-paper); border: 1px solid var(--tdue-line); border-radius: var(--tdue-radius); margin-bottom: 1rem;
}
.tdue-f { display: flex; flex-direction: column; gap: .3rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.tdue-f > label, .tdue-f > legend { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tdue-muted); padding: 0; margin-bottom: .3rem; }
.tdue .tdue-f select, .tdue .tdue-f input[type=date] {
	width: 100%; height: 2.5rem; padding: 0 .6rem; font-size: .95rem; border: 1px solid var(--tdue-line); border-radius: 8px; background: #fff; color: var(--tdue-ink);
}
.tdue-f--types, .tdue-f--period { flex: none; }
.tdue-break { flex-basis: 100%; height: 0; }
.tdue-f--wide { flex: 1 1 12rem; }
.tdue-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.tdue-chip { position: relative; cursor: pointer; margin: 0; }
.tdue-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tdue-chip span {
	display: inline-flex; align-items: center; height: 2.25rem; padding: 0 .75rem; border-radius: 999px; font-size: .88rem; font-weight: 500; white-space: nowrap;
	border: 1px solid var(--tdue-line); background: #fff; color: var(--tdue-ink); transition: background .15s, color .15s, border-color .15s;
}
.tdue-chip input:checked + span { background: var(--tdue-ink); color: #fff; border-color: var(--tdue-ink); }
.tdue-chip input:focus-visible + span { outline: 2px solid var(--tdue-accent); outline-offset: 2px; }
.tdue-link { flex: none; background: none; border: 0; padding: 0 0 .6rem; color: var(--tdue-accent); font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.tdue-filter-toggle { display: none; }

.tdue-count { font-size: .9rem; color: var(--tdue-muted); margin: 0 0 .5rem; }

/* Results */
.tdue-month { margin-bottom: 1.5rem; }
.tdue .tdue-month-h { font-size: 1rem; font-weight: 700; margin: 1rem 0 .6rem; padding-bottom: .4rem; border-bottom: 1px solid var(--tdue-line); text-transform: uppercase; letter-spacing: .06em; color: var(--tdue-muted); }
.tdue-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.tdue .tdue-card {
	display: flex; align-items: center; gap: 1rem; width: 100%; min-width: 0; text-align: left; padding: .9rem 1rem; margin: 0;
	background: var(--tdue-card); color: var(--tdue-ink); border: 1px solid var(--tdue-line); border-radius: var(--tdue-radius);
	cursor: pointer; font: inherit; line-height: 1.35; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tdue .tdue-card:hover { border-color: #cdbfb1; box-shadow: 0 4px 14px rgba(31, 26, 23, .08); background: var(--tdue-card); color: var(--tdue-ink); }
.tdue .tdue-card:focus-visible { outline: 2px solid var(--tdue-accent); outline-offset: 2px; }
.tdue-date { flex: 0 0 3.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 3.6rem; border-radius: 8px; background: var(--tdue-paper); border: 1px solid var(--tdue-line); }
.tdue-date-m { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tdue-accent); }
.tdue-date-d { font-size: 1.35rem; font-weight: 700; line-height: 1; }
.tdue-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.tdue-card-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tdue-card-when { font-size: .82rem; color: var(--tdue-muted); }
.tdue-card-name { font-weight: 650; font-size: 1.02rem; overflow-wrap: anywhere; }
.tdue-card-where { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdue-chev { flex: 0 0 1.1rem; width: 1.1rem; height: 1.1rem; fill: none; stroke: #b5aca4; stroke-width: 2; }

.tdue-type { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .15rem .5rem; border-radius: 4px; color: #fff; background: var(--tdue-festival); }
.tdue-type--marathon { background: var(--tdue-marathon); }
.tdue-type--encuentro { background: var(--tdue-encuentro); }
.tdue-type--milonga { background: var(--tdue-milonga); }

.tdue-empty { text-align: center; padding: 2.5rem 1rem; border: 1px dashed var(--tdue-line); border-radius: var(--tdue-radius); color: var(--tdue-muted); }
.tdue-error { color: #b3261e; }

/* Buttons */
.tdue .tdue-btn {
	display: inline-flex; align-items: center; gap: .4rem; min-height: 2.6rem; padding: 0 1.1rem; border-radius: 8px; font: inherit; font-weight: 600; font-size: .95rem;
	border: 1px solid var(--tdue-ink); background: #fff; color: var(--tdue-ink); cursor: pointer; text-decoration: none;
}
.tdue .tdue-btn:hover { background: var(--tdue-paper); color: var(--tdue-ink); }
.tdue .tdue-btn--primary { background: var(--tdue-accent); border-color: var(--tdue-accent); color: var(--tdue-accent-ink); }
.tdue .tdue-btn--primary:hover { background: #821528; border-color: #821528; color: #fff; }
.tdue .tdue-btn[disabled] { opacity: .6; cursor: progress; }

/* Detail dialog */
.tdue-dialog {
	width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1.75rem; border: 0; border-radius: 14px;
	color: var(--tdue-ink); background: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); overflow: auto;
}
.tdue-dialog::backdrop { background: rgba(20, 16, 14, .55); }
.tdue-dialog[open]:not(:modal) { position: fixed; inset: 1rem; margin: auto; z-index: 99999; }
.tdue .tdue-close { position: absolute; top: .75rem; right: .75rem; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: var(--tdue-paper); color: var(--tdue-ink); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0; }
.tdue .tdue-d-title { font-size: 1.5rem; line-height: 1.2; margin: .6rem 2.5rem 1rem 0; }
.tdue-dl { display: grid; grid-template-columns: 6.5rem 1fr; gap: .45rem 1rem; margin: 0 0 1rem; }
.tdue-dl dt { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tdue-muted); padding-top: .15rem; }
.tdue-dl dd { margin: 0; }
.tdue-desc { margin: 0 0 1.1rem; }
.tdue-meta { font-size: .82rem; color: var(--tdue-muted); margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--tdue-line); }
.tdue-meta a { color: inherit; }

/* Admin panel */
.tdue-manage { margin-top: 2.5rem; border: 1px solid var(--tdue-line); border-radius: var(--tdue-radius); background: var(--tdue-paper); }
.tdue-manage summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 700; }
.tdue-manage summary span { font-weight: 400; color: var(--tdue-muted); font-size: .9rem; }
#tdue-manage-body { padding: 0 1.25rem 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.tdue-panel { background: #fff; border: 1px solid var(--tdue-line); border-radius: 8px; padding: 1rem 1.1rem; min-width: 0; }
.tdue .tdue-panel h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
.tdue .tdue-panel h3:not(:first-child) { margin-top: 1.25rem; }
.tdue-panel p { margin: 0 0 .75rem; font-size: .92rem; }
.tdue-check { display: flex; gap: .5rem; align-items: flex-start; margin: 0 0 .5rem; font-size: .92rem; }
.tdue-check input { margin-top: .3rem; }
.tdue-days { display: flex; flex-wrap: wrap; gap: .35rem; border: 0; padding: 0; margin: .5rem 0 .75rem; }
.tdue-days legend { font-size: .85rem; font-weight: 600; margin-bottom: .35rem; padding: 0; }
.tdue-days .tdue-chip span { height: 2.2rem; padding: 0 .7rem; font-size: .85rem; }
.tdue .tdue-panel textarea { width: 100%; font-size: .85rem; border: 1px solid var(--tdue-line); border-radius: 8px; padding: .5rem; margin: .3rem 0; }
.tdue .tdue-panel input[type=time] { height: 2.3rem; padding: 0 .5rem; border: 1px solid var(--tdue-line); border-radius: 8px; }
.tdue-table-wrap { overflow-x: auto; }
.tdue-table { width: 100%; border-collapse: collapse; font-size: .82rem; margin: 0; }
.tdue-table th, .tdue-table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--tdue-line); vertical-align: top; }
.tdue-ok { color: #2e7d4f; font-weight: 600; }
.tdue-bad { color: #b3261e; font-weight: 600; }
.tdue-note { font-size: .88rem; color: #2e7d4f; }

/* Tablet */
@media (max-width: 900px) {
	.tdue-link { padding: 0 0 .6rem; }
	.tdue-list { grid-template-columns: minmax(0, 1fr); }
	#tdue-manage-body { grid-template-columns: 1fr; }
}

/* Phone */
@media (max-width: 640px) {
	.tdue .tdue-filter-toggle {
		display: inline-flex; align-items: center; height: 2.5rem; padding: 0 1rem; margin: 0 0 .75rem;
		border: 1px solid var(--tdue-line); border-radius: 999px; background: #fff; color: var(--tdue-ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
	}
	.tdue-filters { display: none; gap: .6rem; padding: .85rem; }
	.tdue-filters-open .tdue-filters { display: flex; }
	.tdue-f--types, .tdue-f--period, .tdue-f--wide { flex: 1 1 100%; }
	.tdue-break { display: none; }
	.tdue-filters .tdue-chips { gap: .3rem; }
	.tdue-filters .tdue-chip span { height: 2.1rem; padding: 0 .5rem; font-size: .8rem; }
	.tdue-link { padding: 0; }
	.tdue .tdue-card { padding: .8rem; gap: .8rem; }
	.tdue-date { flex-basis: 3rem; height: 3.3rem; }
	.tdue-chev { display: none; }
	.tdue-dialog { padding: 1.25rem; width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); }
	.tdue-dl { grid-template-columns: 1fr; gap: .1rem; }
	.tdue-dl dd { margin-bottom: .5rem; }
}

/* Per-source update report: one compact line per source (wraps to two on phones). */
.tdue-srcs { list-style: none; margin: .5rem 0 0; padding: 0; border-top: 1px solid var(--tdue-line); font-size: .82rem; line-height: 1.35; }
.tdue-srcs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .75rem; margin: 0; padding: .3rem 0; border-bottom: 1px solid var(--tdue-line); }
.tdue-srcs__name { flex: 1 1 14rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.tdue-srcs__name { color: inherit; text-decoration: none; }
a.tdue-srcs__name:hover { text-decoration: underline; }
.tdue-srcs__res { flex: none; white-space: nowrap; color: var(--tdue-muted, #6b6259); }
.tdue-srcs__err { flex: 1 1 100%; color: var(--tdue-muted, #6b6259); overflow-wrap: anywhere; }
