/* Search form */
.k1-rpt-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin: 0 0 1.5rem; }
.k1-rpt-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 150px; }
.k1-rpt-field--grow { flex: 1 1 260px; }
.k1-rpt-field label { font-size: 0.875rem; color: var(--wp--preset--color--muted, #51656e); }
.k1-rpt-form input, .k1-rpt-form select {
	font: inherit; min-height: 44px; padding: 0.5rem 0.75rem;
	color: var(--wp--preset--color--contrast, #14232b);
	background: var(--wp--preset--color--surface, #fff);
	border: 1px solid var(--wp--preset--color--line, #cfd9d5); border-radius: 4px;
}
.k1-rpt-submit {
	font: inherit; font-weight: 700; min-height: 44px; padding: 0.5rem 1.4rem; cursor: pointer;
	color: var(--wp--preset--color--base, #f2f5f3); background: var(--wp--preset--color--accent, #1e7a3c);
	border: 0; border-radius: 4px;
}
.k1-rpt-submit:hover { filter: brightness(1.1); }
.k1-rpt-form--compact { max-width: 560px; margin-top: 1.5rem; }
.k1-rpt-count, .k1-rpt-empty { color: var(--wp--preset--color--muted, #51656e); }
.k1-rpt-count { margin: 0 0 0.9rem; }

/* Expandable list */
.k1-rpt-list { display: flex; flex-direction: column; gap: 0.65rem; }
.k1-rpt-item {
	background: var(--wp--preset--color--surface, #fff);
	border: 1px solid var(--wp--preset--color--line, #cfd9d5);
	border-left: 4px solid var(--wp--preset--color--accent, #1e7a3c);
	border-radius: 4px;
}
.k1-rpt-item[open] { border-color: var(--wp--preset--color--accent, #1e7a3c); }

.k1-rpt-item > summary {
	display: grid;
	grid-template-columns: minmax(9.5rem, 13rem) minmax(0, 1fr) minmax(3rem, 13rem) auto 1.25rem;
	align-items: center;
	gap: 0.1rem 1rem;
	min-height: 44px;
	padding: 0.4rem 0.8rem;
	cursor: pointer;
	list-style: none;
}
.k1-rpt-item > summary::-webkit-details-marker { display: none; }
/* chevron */
.k1-rpt-item > summary::after {
	content: ""; grid-column: 5; width: 0.55rem; height: 0.55rem; justify-self: end;
	border-right: 2px solid var(--wp--preset--color--muted, #51656e);
	border-bottom: 2px solid var(--wp--preset--color--muted, #51656e);
	transform: rotate(45deg); transition: transform 0.15s;
}
.k1-rpt-item[open] > summary::after { transform: rotate(-135deg); }

.k1-rpt-freq {
	font-family: var(--wp--preset--font-family--mono, ui-monospace, Menlo, Consolas, monospace);
	font-variant-numeric: tabular-nums;
	font-size: 1.15rem; line-height: 1.2; font-weight: 700; white-space: nowrap;
	color: var(--wp--preset--color--accent, #1e7a3c);
}
.k1-rpt-fq { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.k1-rpt-tone {
	font-family: var(--wp--preset--font-family--mono, ui-monospace, Menlo, Consolas, monospace);
	font-variant-numeric: tabular-nums; font-size: 0.85rem; line-height: 1.2;
	color: var(--wp--preset--color--muted, #51656e); overflow-wrap: anywhere;
}
.k1-rpt-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.5rem; }
.k1-rpt-tag {
	font-size: 0.7rem; font-weight: 700; line-height: 1.4; padding: 0.05rem 0.5rem; border-radius: 999px;
	color: var(--wp--preset--color--base, #f2f5f3); background: var(--wp--preset--color--accent, #1e7a3c);
}
.k1-rpt-id { display: flex; flex-direction: column; min-width: 0; }
.k1-rpt-sub { font-size: 0.85rem; line-height: 1.25; color: var(--wp--preset--color--muted, #51656e); }
.k1-rpt-mode { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }
.k1-rpt-status, .k1-rpt-chip { font-size: 0.8rem; padding: 0.1rem 0.55rem; border: 1px solid var(--wp--preset--color--line, #cfd9d5); border-radius: 999px; white-space: nowrap; }

/* Detail panel */
.k1-rpt-detail {
	display: flex; flex-direction: column; gap: 0.4rem;
	padding: 0.5rem 0.8rem 0.6rem;
}
.k1-rpt-drow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.3rem 1rem; }
.k1-rpt-f--tone-in, .k1-rpt-f--mode, .k1-rpt-f--modes { grid-column: span 2; }
.k1-rpt-f--notes { grid-column: span 3; }
.k1-rpt-f { margin: 0; min-width: 0; }
.k1-rpt-f dt { font-size: 0.78rem; line-height: 1.2; color: var(--wp--preset--color--muted, #51656e); }
.k1-rpt-f dd { margin: 0; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.k1-rpt-pages { margin: 1.5rem 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.k1-rpt-pages .page-numbers { display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; text-align: center; text-decoration: none; border: 1px solid var(--wp--preset--color--line, #cfd9d5); border-radius: 4px; padding: 0 0.6rem; }
.k1-rpt-pages .current { background: var(--wp--preset--color--accent, #1e7a3c); color: var(--wp--preset--color--base, #f2f5f3); border-color: transparent; }

/* Phones: stack the summary into two lines */
@media (max-width: 640px) {
	.k1-rpt-item > summary { grid-template-columns: minmax(0, 1fr) auto 1.25rem; }
	.k1-rpt-fq { grid-column: 1; grid-row: 1; align-self: start; }
	.k1-rpt-status { grid-column: 2; grid-row: 1; }
	.k1-rpt-item > summary::after { grid-column: 3; grid-row: 1; }
	.k1-rpt-id { grid-column: 1; grid-row: 2; }
	.k1-rpt-mode { grid-column: 2 / 4; grid-row: 2; justify-self: end; max-width: 12rem; }
}
@media (prefers-reduced-motion: reduce) { .k1-rpt-item > summary::after { transition: none; } }

/* Intro heading and sort control */
.k1-rpt-title { margin: 0 0 0.5rem; }
.k1-rpt-intro ul { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--wp--preset--color--muted, #51656e); }
.k1-rpt-sort { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.75rem; }
.k1-rpt-sort label { font-size: 0.875rem; color: var(--wp--preset--color--muted, #51656e); }
.k1-rpt-sort select {
	font: inherit; min-height: 44px; padding: 0.5rem 0.75rem; min-width: 12rem;
	color: var(--wp--preset--color--contrast, #14232b);
	background: var(--wp--preset--color--surface, #fff);
	border: 1px solid var(--wp--preset--color--line, #cfd9d5); border-radius: 4px;
}

/* Mobile hardening */
.k1-rpt-wrap { max-width: 100%; overflow-wrap: anywhere; }
.k1-rpt-item > summary > * { min-width: 0; }
@media (max-width: 640px) {
	.k1-rpt-form { flex-direction: column; align-items: stretch; }
	.k1-rpt-field, .k1-rpt-field--grow { min-width: 0; flex: 0 0 auto; }
	.k1-rpt-form input, .k1-rpt-form select, .k1-rpt-submit { width: 100%; font-size: 1rem; } /* 16px stops iOS zoom-on-focus */
	.k1-rpt-sort { flex-direction: column; align-items: stretch; gap: 0.6rem; }
	.k1-rpt-sort__field { display: flex; align-items: center; gap: 0.75rem; width: 100%; }
	.k1-rpt-sort__field label { flex: 0 0 4.5rem; }
	.k1-rpt-sort select, .k1-rpt-sort select.k1-rpt-per { flex: 1 1 auto; width: auto; min-width: 0; font-size: 1rem; }
	.k1-rpt-pages .page-numbers { min-width: 40px; padding: 0 0.4rem; }
}
@media (max-width: 380px) {
	.k1-rpt-item > summary { padding: 0.4rem 0.65rem; gap: 0.1rem 0.6rem; }
	.k1-rpt-freq { font-size: 1.05rem; }
	.k1-rpt-detail { padding: 0.45rem 0.65rem 0.55rem; gap: 0.35rem; }
	.k1-rpt-drow { gap: 0.3rem 0.9rem; }
}

/* Off-air repeaters: red instead of green */
.k1-rpt-item.k1-rpt-item--off { border-left-color: var(--wp--preset--color--danger, #c62828); }
.k1-rpt-item.k1-rpt-item--off[open] { border-color: var(--wp--preset--color--danger, #c62828); }
.k1-rpt-item--off .k1-rpt-freq { color: var(--wp--preset--color--danger, #c62828); }
.k1-rpt-item--off .k1-rpt-status { color: var(--wp--preset--color--danger, #c62828); border-color: var(--wp--preset--color--danger, #c62828); font-weight: 600; }

/* Narrow screens: first row wraps to two columns (Updated stays last) */
@media (max-width: 520px) {
	.k1-rpt-drow { grid-template-columns: 1fr 1fr; }
	.k1-rpt-f--tone-in, .k1-rpt-f--mode, .k1-rpt-f--modes { grid-column: auto; }
	.k1-rpt-f--notes, .k1-rpt-f--updated { grid-column: 1 / -1; }
}

/* MHz label beside frequencies */
.k1-rpt-unit {
	margin-left: 0.25rem; font-family: var(--wp--preset--font-family--body, system-ui, sans-serif);
	font-size: 0.7em; font-weight: 400; color: var(--wp--preset--color--muted, #51656e);
}

/* Blank values */
.k1-rpt-none { color: var(--wp--preset--color--muted, #51656e); }

/* Mid-size screens: three columns, still lined up across rows */
@media (min-width: 521px) and (max-width: 760px) {
	.k1-rpt-drow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.k1-rpt-f--tone-in, .k1-rpt-f--mode, .k1-rpt-f--modes { grid-column: auto; }
	.k1-rpt-f--notes { grid-column: 1 / -1; }
	.k1-rpt-f--updated { grid-column: 3; }
}
.k1-rpt-icon { flex: none; }

/* Linked Nets badge: blue */
.k1-rpt-nets {
	--k1-blue: #1b5fb8;
	display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.25rem; text-decoration: none;
	color: var(--k1-blue); border-color: var(--k1-blue);
}
.k1-rpt-nets:hover { background: var(--k1-blue); color: #fff; }
:root[data-theme="dark"] .k1-rpt-nets { --k1-blue: #5aa2f0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .k1-rpt-nets { --k1-blue: #5aa2f0; } }
:root[data-theme="dark"] .k1-rpt-nets:hover { color: #0e1a21; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .k1-rpt-nets:hover { color: #0e1a21; } }

/* Expand / collapse all */
.k1-rpt-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 0 0 0.9rem; }
.k1-rpt-bar .k1-rpt-count { margin: 0; }
.k1-rpt-toggle {
	font: inherit; font-size: 0.9rem; font-weight: 600; min-height: 44px; padding: 0.4rem 1rem; cursor: pointer;
	color: var(--wp--preset--color--contrast, #14232b);
	background: var(--wp--preset--color--surface, #fff);
	border: 1px solid var(--wp--preset--color--line, #cfd9d5); border-radius: 4px;
}
.k1-rpt-toggle:hover { border-color: var(--wp--preset--color--accent, #1e7a3c); }
@media (max-width: 640px) { .k1-rpt-toggle { width: 100%; } }

/* Desktop list rows: callsign lines up with the frequency, city/state with the tone */
@media (min-width: 641px) {
	.k1-rpt-fq, .k1-rpt-id { display: contents; }
	.k1-rpt-freq { grid-column: 1; grid-row: 1; align-self: baseline; }
	.k1-rpt-tone { grid-column: 1; grid-row: 2; align-self: baseline; }
	.k1-rpt-line { grid-column: 2; grid-row: 1; align-self: baseline; }
	.k1-rpt-sub  { grid-column: 2; grid-row: 2; align-self: baseline; }
	.k1-rpt-mode { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
	.k1-rpt-status { grid-column: 4; grid-row: 1 / span 2; align-self: center; }
	.k1-rpt-item > summary::after { grid-row: 1 / span 2; align-self: center; }
}

/* Collapsed row: tight line heights so the text sits centered in the row */
.k1-rpt-line, .k1-rpt-line strong { line-height: 1.2; }
.k1-rpt-item > summary { align-content: center; }

/* More air, and a stronger rule, between the row and its details */
.k1-rpt-item[open] > summary { padding-bottom: 0.7rem; }
.k1-rpt-detail { padding-top: 0.8rem; padding-bottom: 0.8rem; border-top: 0; }

/* Mode tags: same look as the Local tag, in orange */
.k1-rpt-mode { gap: 0.25rem; }
.k1-rpt-mode .k1-rpt-chip {
	font-size: 0.7rem; font-weight: 700; line-height: 1.4; padding: 0.05rem 0.5rem; border: 0;
	color: #fff; background: #c2570a;
}
:root[data-theme="dark"] .k1-rpt-mode .k1-rpt-chip { color: #1a1208; background: #f0a640; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .k1-rpt-mode .k1-rpt-chip { color: #1a1208; background: #f0a640; } }

/* Results-per-page select */
.k1-rpt-sort select.k1-rpt-per { min-width: 5.5rem; }

/* Linked nets page */
.k1-rpt-net { margin: 3.25rem 0 0; }
.k1-rpt-bar + .k1-rpt-net { margin-top: 1.5rem; }
.k1-rpt-net-title { margin: 0 0 1rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--wp--preset--color--line, #cfd9d5); }
.k1-rpt-net-count { margin-left: 0.4rem; font-size: 0.85rem; font-weight: 400; white-space: nowrap; color: var(--wp--preset--color--muted, #51656e); }

.k1-rpt-net { scroll-margin-top: 1rem; }

/* Select boxes: rounded, themed arrow, accent on hover and focus */
.k1-rpt-form select, .k1-rpt-sort select {
	-webkit-appearance: none; appearance: none; cursor: pointer;
	padding-right: 2.5rem; border-radius: 8px; font-weight: 500;
	background-color: var(--wp--preset--color--surface, #fff);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2351656e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 0.9rem center; background-size: 12px 8px;
	transition: border-color 0.15s;
}
:root[data-theme="dark"] .k1-rpt-form select, :root[data-theme="dark"] .k1-rpt-sort select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239fb3ba' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .k1-rpt-form select, :root:not([data-theme="light"]) .k1-rpt-sort select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239fb3ba' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
.k1-rpt-form select:hover, .k1-rpt-sort select:hover,
.k1-rpt-form select:focus, .k1-rpt-sort select:focus,
.k1-rpt-form input:focus { border-color: var(--wp--preset--color--accent, #1e7a3c); }
.k1-rpt-form select option, .k1-rpt-sort select option {
	background: var(--wp--preset--color--surface, #fff); color: var(--wp--preset--color--contrast, #14232b);
}
/* matching corners on the neighbouring controls */
.k1-rpt-form input, .k1-rpt-submit, .k1-rpt-toggle { border-radius: 8px; }

.k1-rpt-sort__field { display: flex; align-items: center; gap: 0.75rem; }
