.aft-tool {
	--aft-primary: #2563eb;
	--aft-secondary: #06b6d4;
	--aft-accent: #f59e0b;
	--aft-bg: #f8fafc;
	--aft-surface: #fff;
	--aft-text: #172033;
	--aft-muted: #64748b;
	--aft-border: #d9e2ec;
	--aft-error: #dc2626;
	--aft-success: #15803d;
	color: var(--aft-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.5;
}
.aft-tool *, .aft-tool *::before, .aft-tool *::after { box-sizing: border-box; }
.aft-shell {
	max-width: 920px;
	margin: 2rem auto;
	padding: 1rem;
	background: var(--aft-bg);
	border: 1px solid var(--aft-border);
	border-radius: 20px;
	box-shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
}
.aft-header { padding: 1rem .5rem 1.25rem; text-align: center; }
.aft-header h2 { margin: .25rem 0 .5rem; font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.15; }
.aft-header p { max-width: 680px; margin: 0 auto; color: var(--aft-muted); }
.aft-kicker { color: var(--aft-primary) !important; font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.aft-safety {
	margin-bottom: 1rem;
	padding: .9rem 1rem;
	border-left: 4px solid var(--aft-accent);
	border-radius: 8px;
	background: rgba(245, 158, 11, .1);
}
.aft-safety p { margin: .25rem 0 0; }
.aft-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .4rem;
	margin-bottom: 1rem;
	padding: .35rem;
	background: #e9edf3;
	border-radius: 12px;
}
.aft-tab {
	min-height: 44px;
	padding: .7rem;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--aft-muted);
	font: inherit;
	font-weight: 750;
	cursor: pointer;
}
.aft-tab.is-active { background: var(--aft-surface); color: var(--aft-primary); box-shadow: 0 2px 8px rgba(23,32,51,.08); }
.aft-panel, .aft-controls-card, .aft-results, .aft-history {
	padding: 1rem;
	background: var(--aft-surface);
	border: 1px solid var(--aft-border);
	border-radius: 15px;
}
.aft-frequency-display { display: grid; gap: .8rem; text-align: center; }
.aft-frequency-display > label { font-weight: 800; }
.aft-number-wrap { display: flex; align-items: baseline; justify-content: center; gap: .5rem; }
.aft-number-wrap input {
	width: min(100%, 320px);
	padding: .3rem;
	border: 0;
	border-bottom: 2px solid var(--aft-border);
	background: transparent;
	color: var(--aft-text);
	font-size: clamp(2.6rem, 10vw, 5rem);
	font-weight: 850;
	text-align: center;
}
.aft-number-wrap span { color: var(--aft-muted); font-size: 1.2rem; font-weight: 800; }
.aft-tool input[type="range"] { width: 100%; accent-color: var(--aft-primary); }
.aft-step-controls, .aft-chip-row, .aft-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; }
.aft-step-controls { margin-top: 1rem; }
.aft-icon-button, .aft-chip {
	min-height: 42px;
	padding: .55rem .75rem;
	border: 1px solid var(--aft-border);
	border-radius: 10px;
	background: var(--aft-surface);
	color: var(--aft-text);
	font: inherit;
	font-weight: 750;
	cursor: pointer;
}
.aft-presets { margin-top: 1.25rem; }
.aft-presets h3 { margin: 0 0 .65rem; font-size: 1rem; }
.aft-chip { border-radius: 999px; }
.aft-controls-card { margin-top: 1rem; }
.aft-grid { display: grid; gap: 1rem; }
.aft-field { display: grid; gap: .4rem; }
.aft-field label { font-size: .9rem; font-weight: 750; }
.aft-field input[type="number"], .aft-field select {
	min-height: 44px;
	width: 100%;
	padding: .55rem .7rem;
	border: 1px solid var(--aft-border);
	border-radius: 9px;
	background: var(--aft-surface);
	color: var(--aft-text);
	font: inherit;
}
.aft-range-labels { display: flex; justify-content: space-between; color: var(--aft-muted); font-size: .78rem; }
.aft-actions { margin: 1rem 0; }
.aft-button {
	min-height: 44px;
	padding: .7rem 1rem;
	border: 1px solid transparent;
	border-radius: 10px;
	font: inherit;
	font-weight: 750;
	cursor: pointer;
}
.aft-button:disabled { opacity: .5; cursor: not-allowed; }
.aft-button-primary { background: var(--aft-primary); color: #fff; box-shadow: 0 8px 18px rgba(37,99,235,.2); }
.aft-button-danger { background: var(--aft-error); color: #fff; }
.aft-button-secondary { border-color: var(--aft-border); background: var(--aft-surface); color: var(--aft-text); }
.aft-tool button:focus-visible, .aft-tool input:focus-visible, .aft-tool select:focus-visible {
	outline: 3px solid rgba(37, 99, 235, .35);
	outline-offset: 3px;
}
.aft-error {
	margin: 1rem 0;
	padding: .9rem 1rem;
	border: 1px solid rgba(220,38,38,.25);
	border-radius: 10px;
	background: rgba(220,38,38,.07);
	color: var(--aft-error);
}
.aft-countdown {
	margin: 1rem 0;
	padding: 1rem;
	border-radius: 12px;
	background: rgba(37,99,235,.08);
	color: var(--aft-primary);
	font-size: 1.2rem;
	font-weight: 800;
	text-align: center;
}
.aft-results { margin-top: 1rem; }
.aft-status-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border-radius: 13px; background: linear-gradient(135deg, rgba(37,99,235,.1), rgba(6,182,212,.1)); }
.aft-status-row span { display: block; color: var(--aft-muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; }
.aft-live-frequency { color: var(--aft-primary); font-size: clamp(1.6rem, 6vw, 2.6rem); font-weight: 850; }
.aft-result-grid { display: grid; gap: .8rem; margin-top: 1rem; }
.aft-result-card { display: grid; gap: .3rem; padding: .9rem; border: 1px solid var(--aft-border); border-radius: 10px; }
.aft-result-card span { color: var(--aft-muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; }
.aft-copy-status { min-height: 1.5em; color: var(--aft-success); text-align: center; }
.aft-history { margin-top: 1rem; }
.aft-history-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.aft-history h3 { margin: 0; font-size: 1.05rem; }
.aft-link-button { border: 0; background: transparent; color: var(--aft-primary); font: inherit; font-weight: 750; cursor: pointer; }
.aft-history-item { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--aft-border); }
.aft-history-item:last-child { border-bottom: 0; }
.aft-history-item small { color: var(--aft-muted); }
.aft-empty { margin: .8rem 0 0; color: var(--aft-muted); }
.aft-disclaimer { margin: 1rem 0 0; color: var(--aft-muted); font-size: .85rem; text-align: center; }
[hidden] { display: none !important; }
@media (min-width: 640px) {
	.aft-shell { padding: 1.5rem; }
	.aft-grid, .aft-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.aft-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
	.aft-tool *, .aft-tool *::before, .aft-tool *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
