:root {
	--bg: #f7f6f2;
	--card: #ffffff;
	--ink: #1d1c1a;
	--muted: #66625b;
	--line: #e2ded5;
	--accent: #1f7a2e;
	--accent-ink: #ffffff;
	--warn: #8a5a00;
	--tip-bg: #1d1c1a;
	--tip-ink: #f7f6f2;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #141413;
		--card: #1d1d1b;
		--ink: #ecebe6;
		--muted: #a19d94;
		--line: #34322e;
		--accent: #4cc35d;
		--accent-ink: #0b1a0d;
		--warn: #e6b04a;
		--tip-bg: #ecebe6;
		--tip-ink: #141413;
		color-scheme: dark;
	}
}
* { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 17px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
main { max-width: 640px; margin: 0 auto; padding: 40px 16px 56px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
h1 { font-size: 28px; margin: 0; letter-spacing: 0.02em; }
h1 small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 32px 0 10px; display: flex; align-items: center; gap: 6px; }
a { color: var(--accent); }
.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 6px 20px;
}
.row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 0;
	border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row .name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
/* Action buttons stay quiet until the pointer or focus is on them or their row. */
button, .btn {
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 6px 16px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.row:hover button, .row:hover .btn, ul.apps li:hover button, .title:hover button,
.row:focus-within button, .row:focus-within .btn, ul.apps li:focus-within button {
	border-color: var(--accent);
	color: var(--accent);
}
button:hover, .btn:hover, button:focus-visible, .btn:focus-visible {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink) !important;
}
button:focus-visible, .btn:focus-visible, .tip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.row { justify-content: flex-start; }
.row .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .sub { font-size: 14px; color: var(--muted); }
.row .step {
	flex: none;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--bg);
	border: 1px solid var(--line);
	font-size: 13px;
	font-weight: 600;
	color: var(--muted);
}
.row .name a { color: inherit; text-decoration: none; }
.row .name a:hover { text-decoration: underline; }
ul.apps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 8px;
}
ul.apps li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	column-gap: 10px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 10px 10px 10px 14px;
	transition: border-color 0.12s;
}
ul.apps li:hover { border-color: var(--muted); }
ul.apps .name { font-weight: 600; color: var(--ink); text-decoration: none; }
ul.apps .name:hover { text-decoration: underline; color: var(--accent); }
ul.apps .sub {
	grid-row: 2;
	font-size: 14px;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
ul.apps esp-web-install-button { grid-row: 1 / span 2; grid-column: 2; }
ul.apps button { padding: 4px 12px; font-size: 14px; }
[slot="unsupported"], [slot="not-allowed"] { color: var(--warn); font-size: 15px; }

/* Hover / focus tooltip: <span class="tip" tabindex="0" data-tip="…">?</span> */
.tip {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border: 1px solid currentColor;
	border-radius: 50%;
	font: 600 12px/1 ui-monospace, Menlo, monospace;
	color: var(--muted);
	cursor: help;
}
.tip::after {
	content: attr(data-tip);
	position: absolute;
	left: 50%;
	bottom: calc(100% + 8px);
	transform: translateX(-50%);
	width: max-content;
	max-width: min(280px, 80vw);
	padding: 8px 12px;
	border-radius: 8px;
	background: var(--tip-bg);
	color: var(--tip-ink);
	font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
	white-space: pre-line;
	text-align: left;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.12s;
	z-index: 10;
}
.tip:hover::after, .tip:focus::after { opacity: 1; }

/* program page */
.title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.title .sub { margin: 4px 0 0; color: var(--muted); }
.title .act { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.doc article { overflow-wrap: anywhere; }
.doc article h2 { font-size: 19px; color: var(--ink); margin: 28px 0 8px; }
.doc article h3, .doc article h4 { font-size: 17px; margin: 22px 0 6px; }
.doc article p { margin: 10px 0; }
.doc article ul, .doc article ol { padding-left: 22px; }
.doc article code {
	font-size: 14px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 0 4px;
}
.doc article table {
	display: block;
	overflow-x: auto;
	border-collapse: collapse;
	margin: 12px 0;
	font-size: 15px;
}
.doc article th, .doc article td { border-bottom: 1px solid var(--line); padding: 7px 12px 7px 0; text-align: left; vertical-align: top; }
.doc article th { color: var(--muted); font-weight: 600; }
.doc article td:first-child { white-space: nowrap; }

/* help page */
ol { padding-left: 22px; margin: 0; }
ol li, .help p { margin: 8px 0; }
.help .card { padding: 14px 20px; }
kbd {
	font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
	border: 1px solid var(--line);
	border-bottom-width: 2px;
	border-radius: 4px;
	padding: 2px 6px;
	background: var(--bg);
}
code { font: 15px ui-monospace, SFMono-Regular, Menlo, monospace; }
footer { margin-top: 40px; color: var(--muted); font-size: 14px; }
