/* Entries shown on the site (includes/display.php): [siform_entries], [siform_entry],
 * [siform_value], [siform_stat], [siform_chart]. Inherits the theme's font and
 * colours; set --siform-accent on a parent to change the accent. */

.siform-entries, .siform-entry, .siform-chart {
	--siform-accent: #6366f1;
	--siform-line: color-mix(in srgb, currentColor 14%, transparent);
	--siform-soft: color-mix(in srgb, currentColor 5%, transparent);
	--siform-muted: color-mix(in srgb, currentColor 62%, transparent);
	margin: 1.25em 0;
}

/* Search */
.siform-entries-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.siform-entries-search input[type="search"] { flex: 1 1 220px; min-width: 0; padding: 8px 12px; border: 1px solid var(--siform-line); border-radius: 8px; font: inherit; color: inherit; background: transparent; }
.siform-entries-search button { padding: 8px 16px; border: 0; border-radius: 8px; font: inherit; font-weight: 600; color: #fff; background: var(--siform-accent); cursor: pointer; }

/* Table */
.siform-table-wrap { overflow-x: auto; border: 1px solid var(--siform-line); border-radius: 10px; }
.siform-table { width: 100%; margin: 0; border-collapse: collapse; font-size: .95em; }
.siform-table th, .siform-table td { padding: 10px 14px; border: 0; border-bottom: 1px solid var(--siform-line); text-align: start; vertical-align: top; }
.siform-table tbody tr:last-child td { border-bottom: 0; }
.siform-table thead th { background: var(--siform-soft); font-size: .85em; font-weight: 600; white-space: nowrap; }
.siform-table thead a { color: inherit; text-decoration: none; }
.siform-table thead a:hover, .siform-table thead a:focus-visible { color: var(--siform-accent); }
.siform-sort { margin-inline-start: 4px; font-size: .75em; color: var(--siform-accent); }
.siform-empty { color: var(--siform-muted); }

/* List / single entry */
.siform-entry-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.siform-entry-card, .siform-entry { padding: 14px 16px; border: 1px solid var(--siform-line); border-radius: 10px; }
.siform-answers { display: grid; gap: 8px; margin: 0; }
.siform-answers > div { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 12px; }
.siform-answers dt { margin: 0; font-size: .85em; font-weight: 600; color: var(--siform-muted); }
.siform-answers dd { margin: 0; }
.siform-entry-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--siform-line); font-size: .85em; color: var(--siform-muted); }
.siform-edit { font-weight: 600; color: var(--siform-accent); }

/* Pages */
.siform-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; font-size: .9em; }
.siform-pager span { flex: 1; color: var(--siform-muted); }
.siform-pager a { padding: 6px 12px; border: 1px solid var(--siform-line); border-radius: 8px; text-decoration: none; color: inherit; }
.siform-pager a:hover, .siform-pager a:focus-visible { border-color: var(--siform-accent); color: var(--siform-accent); }

.siform-display-empty { color: var(--siform-muted); }
.siform-display-note { padding: 8px 12px; border-inline-start: 3px solid #d97706; background: #fffbeb; color: #92400e; font-size: .9em; }

/* Charts */
.siform-chart figcaption { margin: 0 0 10px; font-weight: 600; }
.siform-bars { display: grid; gap: 8px; }
.siform-bar { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; align-items: center; gap: 10px; font-size: .92em; }
.siform-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.siform-bar-track { height: 12px; border-radius: 99px; background: var(--siform-soft); overflow: hidden; }
.siform-bar-fill { display: block; height: 100%; border-radius: 99px; background: var(--siform-accent); }
.siform-bar-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.siform-bar-num small { font-weight: 400; color: var(--siform-muted); }
.siform-columns { display: block; width: 100%; height: auto; }
.siform-columns rect { fill: var(--siform-accent); }
.siform-columns text { font-size: 15px; fill: currentColor; opacity: .65; } /* SVG units: the chart scales with its width */
.siform-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.siform-pie svg { flex: none; width: 160px; height: 160px; transform: rotate(-90deg); }
.siform-pie-bg { stroke: var(--siform-soft); }
.siform-legend { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .92em; }
.siform-legend small { color: var(--siform-muted); }
.siform-swatch { display: inline-block; width: 10px; height: 10px; margin-inline-end: 8px; border-radius: 3px; vertical-align: baseline; }
.siform-c0 { stroke: #6366f1; background: #6366f1; } .siform-c1 { stroke: #10b981; background: #10b981; }
.siform-c2 { stroke: #f59e0b; background: #f59e0b; } .siform-c3 { stroke: #ef4444; background: #ef4444; }
.siform-c4 { stroke: #06b6d4; background: #06b6d4; } .siform-c5 { stroke: #8b5cf6; background: #8b5cf6; }
.siform-c6 { stroke: #ec4899; background: #ec4899; } .siform-c7 { stroke: #64748b; background: #64748b; }

@media (max-width: 600px) {
	/* Each row becomes a small card, with the column name before each answer. */
	.siform-table-wrap { border: 0; overflow: visible; }
	.siform-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.siform-table, .siform-table tbody, .siform-table tr, .siform-table td { display: block; width: 100%; }
	.siform-table tr { margin-bottom: 10px; border: 1px solid var(--siform-line); border-radius: 10px; }
	.siform-table td { display: grid; grid-template-columns: 40% 1fr; gap: 10px; padding: 8px 12px; }
	.siform-table td::before { content: attr(data-label); font-size: .85em; font-weight: 600; color: var(--siform-muted); }
	.siform-answers > div { grid-template-columns: 1fr; gap: 2px; }
	.siform-bar { grid-template-columns: 1fr auto; }
	.siform-bar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* [siform_leaderboard] */
.siform-board { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.siform-board caption { text-align: start; font-weight: 600; padding: 0 0 8px; }
.siform-board th, .siform-board td { padding: 8px 10px; text-align: start; border-bottom: 1px solid rgba(127, 127, 127, .25); }
.siform-board th { font-size: 0.85em; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
.siform-board td:first-child { width: 3em; font-variant-numeric: tabular-nums; font-weight: 600; }
.siform-board tr.is-top-1 td:first-child { color: #b7791f; }
.siform-board tr.is-top-2 td:first-child { color: #718096; }
.siform-board tr.is-top-3 td:first-child { color: #9c4221; }
.siform-board-empty { opacity: .75; }
