/* HAM Thailand Repeater Directory — front-end */
.hamdir-app, .hamdir-form {
	--hd-accent: #0b5cad;
	--hd-border: #d9dee5;
	--hd-soft: #f4f7fb;
	--hd-muted: #667085;
	--hd-on: #12a150;
	font-size: 15px;
	line-height: 1.5;
}
.hamdir-app *, .hamdir-form * { box-sizing: border-box; }

/* Today panel */
.hd-today { border: 1px solid var(--hd-border); border-left: 4px solid var(--hd-accent); background: var(--hd-soft); border-radius: 8px; padding: 12px 14px; margin: 0 0 18px; }
.hd-today-head { margin-bottom: 8px; }
.hd-clock { color: var(--hd-muted); font-variant-numeric: tabular-nums; margin-left: 6px; }
.hd-today-list { list-style: none; margin: 0; padding: 0; }
.hd-today-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-top: 1px dashed var(--hd-border); }
.hd-today-list li:first-child { border-top: 0; }
.hd-today-list li.st-done { opacity: .55; }
.hd-today-list .hd-t { font-variant-numeric: tabular-nums; min-width: 120px; font-weight: 600; }
.hd-today-list .hd-pick { font-weight: 700; color: var(--hd-accent); text-decoration: none; min-width: 90px; }
.hd-today-list .hd-p { color: var(--hd-muted); min-width: 90px; }
.hd-today-list .hd-tn { flex-basis: 100%; color: var(--hd-muted); padding-left: 130px; }

.hd-air { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.hd-air.on { background: var(--hd-on); color: #fff; animation: hdpulse 1.6s infinite; }
.hd-air.up { background: #fff4d6; color: #8a5a00; }
.hd-air.done { background: #eceff3; color: var(--hd-muted); }
@keyframes hdpulse { 50% { opacity: .65; } }

/* Toolbar */
.hd-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; scroll-margin-top: 80px; }
.hd-toolbar .hd-q { flex: 1 1 320px; }
.hd-toolbar input, .hd-toolbar select { padding: 9px 12px; border: 1px solid var(--hd-border); border-radius: 6px; font-size: 15px; background: #fff; min-height: 42px; }
.hd-toolbar select { flex: 0 1 200px; }
.hd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.hd-chip { border: 1px solid var(--hd-border); background: #fff; color: inherit; padding: 4px 12px; border-radius: 99px; cursor: pointer; font-size: 14px; }
.hd-chip { border-left: 4px solid var(--c, var(--hd-border)); }
.hd-chip.active { background: var(--c, var(--hd-accent)); border-color: var(--c, var(--hd-accent)); color: #fff; }
.hd-chip[data-sys=""].active { background: var(--hd-accent); }
.hd-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 10px; font-size: 14px; }
.hd-count { color: var(--hd-muted); margin-left: auto; }
.hd-reset { background: none; border: 0; color: var(--hd-accent); cursor: pointer; text-decoration: underline; padding: 0; font-size: 14px; }

/* Table */
.hd-table-wrap { overflow-x: auto; }
.hd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hd-table th, .hd-table td { border-bottom: 1px solid var(--hd-border); padding: 8px 10px; text-align: left; vertical-align: top; }
.hd-table thead th { background: var(--hd-soft); white-space: nowrap; position: sticky; top: 0; }
.hd-sortable { cursor: pointer; user-select: none; }
.hd-sortable::after { content: ' ↕'; color: #b0b7c3; }
.hd-sortable.asc::after { content: ' ▲'; color: var(--hd-accent); }
.hd-sortable.desc::after { content: ' ▼'; color: var(--hd-accent); }
.hd-table tr.hd-onair td { background: #eefaf2; }
.hd-cs { font-size: 15px; }
.hd-type-l { color: var(--hd-muted); }
.hd-unv { font-size: 11px; background: #fff4d6; color: #8a5a00; padding: 0 6px; border-radius: 4px; }
.hd-more { background: none; border: 0; padding: 0; color: var(--hd-accent); cursor: pointer; font-size: 12px; }
.hd-detail td { background: var(--hd-soft); font-size: 13px; }
.hd-empty { text-align: center; color: var(--hd-muted); padding: 24px !important; }
.hd-report { font-weight: 600; }

.hd-sys { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; margin: 1px 0; border: 1px solid; white-space: nowrap; }

/* Mobile: table becomes cards */
@media (max-width: 760px) {
	.hd-table thead { display: none; }
	.hd-table, .hd-table tbody, .hd-table tr, .hd-table td { display: block; width: 100%; }
	.hd-table tr { border: 1px solid var(--hd-border); border-radius: 8px; margin-bottom: 10px; padding: 6px 4px; }
	.hd-table tr.hd-detail { margin-top: -12px; border-top: 0; border-radius: 0 0 8px 8px; }
	.hd-table td { border: 0; padding: 3px 8px; display: flex; gap: 8px; }
	.hd-table td::before { content: attr(data-label); flex: 0 0 100px; color: var(--hd-muted); font-size: 12px; }
	.hd-table td:empty { display: none; }
	.hd-table td[data-label="Callsign"] { display: block; }
	.hd-table td[data-label="Callsign"]::before { display: none; }
	.hd-detail td { display: block; }
	.hd-today-list .hd-tn { padding-left: 0; }
	.hd-count { margin-left: 0; flex-basis: 100%; }
}

/* Static fallback (no JS) */
.hamdir-static .hd-table { font-size: 13px; }

/* Member form */
.hamdir-form fieldset { border: 1px solid var(--hd-border); border-radius: 8px; padding: 12px 16px 6px; margin: 0 0 16px; }
.hamdir-form legend { font-weight: 700; padding: 0 6px; }
.hd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; margin-bottom: 10px; }
.hamdir-form label { display: block; font-size: 14px; }
.hamdir-form input:not([type=checkbox]), .hamdir-form select, .hamdir-form textarea { display: block; width: 100%; margin-top: 3px; padding: 8px 10px; border: 1px solid var(--hd-border); border-radius: 6px; font-size: 15px; background: #fff; }
.hd-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; align-items: center; }
.hd-checks label { display: inline-flex; align-items: center; gap: 4px; }
.hd-checks > span { font-weight: 600; font-size: 14px; }
.hd-full { margin-bottom: 14px; }
.hd-captcha input { display: inline-block !important; width: 90px !important; margin-left: 6px; }
.hd-hp { position: absolute !important; left: -9999px; height: 0; overflow: hidden; }
.hd-btn { background: var(--hd-accent); color: #fff; border: 0; padding: 11px 28px; border-radius: 6px; font-size: 16px; cursor: pointer; }
.hd-btn:hover { filter: brightness(1.1); }
.hd-errors { background: #fdecea; border: 1px solid #f5c2c0; border-radius: 6px; padding: 8px 14px; margin-bottom: 14px; }
.hd-errors p { margin: 4px 0; }
.hd-note { background: #fff4d6; padding: 8px 12px; border-radius: 6px; }
.hd-small { font-size: 13px; color: var(--hd-muted); }
.hd-success { border: 1px solid #b7e4c7; background: #effaf3; border-radius: 8px; padding: 16px 20px; }

.hd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.hd-span { grid-column: 1 / -1; }
