:root {
	color-scheme: light dark;
	--bg: #ffffff;
	--fg: #0b0d12;
	--muted: #5b6472;
	--accent: #2f6df6;
	--border: #e4e7ec;
	--danger: #b42318;
	--radius: 10px;
	--space: 1rem;
	--font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0b0d12;
		--fg: #f4f6fa;
		--muted: #9aa4b2;
		--accent: #6f9bff;
		--border: #232833;
		--danger: #ff9a8f;
	}
}

* {
	box-sizing: border-box;
}

:root { --p: #9d4edd; --c: #00f0ff; --accent: #00f0ff; }
html, body { background: #07060d !important; color: #eceaf5 !important; color-scheme: dark; }
body {
	background-image: radial-gradient(600px 400px at 0% 0%, #9d4edd33, transparent), radial-gradient(500px 400px at 100% 100%, #00f0ff22, transparent) !important;
	background-attachment: fixed;
}
.ff { max-width: 560px; margin: 0 auto; padding: 1.5rem 1rem 2rem; }
.ff-head { text-align: center; margin-bottom: 1.25rem; }
.ff-tag { font-size: .7rem; letter-spacing: .25em; color: var(--c); border: 1px solid #00f0ff55; padding: .25rem .7rem; border-radius: 99px; }
.ff-head h1 { font-size: clamp(2.4rem, 11vw, 3.4rem); margin: .6rem 0 0; font-weight: 900; letter-spacing: -.02em; font-style: italic; text-transform: uppercase; }
.neon-p { color: var(--p); text-shadow: 0 0 18px #9d4eddaa; }
.neon-c { color: var(--c); text-shadow: 0 0 18px #00f0ffaa; }
.ff-sub { margin: 0; color: #b8b2cc; font-weight: 600; }
.ff-muted { color: #8d87a3; }
.ff-panel { background: #110f1cdd; border: 1px solid #9d4edd44; border-radius: 18px; padding: 1.1rem; box-shadow: 0 0 40px #9d4edd1f; }
.ff-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .15em; color: #a59fbd; margin: .4rem 0 .6rem; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.opt { background: #191628; color: #d9d4ea; border: 1px solid #2a2540; border-radius: 12px; padding: .75rem .3rem;
	display: flex; flex-direction: column; align-items: center; gap: .2rem; font: inherit; font-size: .82rem; cursor: pointer; transition: .2s; }
.opt small { color: #8d87a3; font-size: .7rem; }
.opt-ic { font-size: 1.3rem; }
.opt.on { border-color: var(--c); background: #00f0ff12; box-shadow: 0 0 14px #00f0ff44, inset 0 0 10px #00f0ff22; color: #fff; }
.cta { width: 100%; border: 0; border-radius: 14px; padding: 1rem; font: inherit; font-weight: 800; font-size: 1.05rem; text-transform: uppercase;
	letter-spacing: .06em; color: #fff; cursor: pointer; background: linear-gradient(90deg, var(--p), #6a5cff, var(--c)); box-shadow: 0 0 24px #9d4edd77; }
.cta:active { transform: scale(.98); }
.cta.alt { margin-top: 1rem; background: transparent; border: 1.5px solid var(--c); color: var(--c); box-shadow: 0 0 16px #00f0ff44; }
.ff-loading { text-align: center; padding: 2rem 1.1rem; }
.ring { --p: 0; width: 140px; height: 140px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
	background: conic-gradient(#00f0ff calc(var(--p) * 1%), #9d4edd calc(var(--p) * 1%), #231d38 0); box-shadow: 0 0 30px #00f0ff44; }
.ring span { width: 116px; height: 116px; border-radius: 50%; background: #110f1c; display: grid; place-items: center; font-size: 2rem; font-weight: 900; }
.load-title { font-weight: 800; font-size: 1.15rem; margin: 1rem 0 .2rem; }
.bar { height: 6px; background: #231d38; border-radius: 9px; overflow: hidden; margin-top: 1rem; }
.bar div { height: 100%; background: linear-gradient(90deg, var(--p), var(--c)); transition: width .15s; }
.ff-results { margin-top: 1.5rem; scroll-margin-top: 1rem; }
.res-title { text-align: center; text-transform: uppercase; font-style: italic; scroll-margin-top: 1rem; }
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.res { background: #110f1c; border: 1px solid #9d4edd55; border-radius: 14px; padding: .8rem; display: flex; flex-direction: column; gap: .3rem; }
.res:last-child { grid-column: 1 / -1; border-color: #00f0ff66; }
.res.awm { border-color: #ff4fd877; }
.res-l { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: #a59fbd; }
.res-v { font-size: 1.9rem; font-weight: 900; color: var(--c); text-shadow: 0 0 12px #00f0ff88; line-height: 1.1; }
.mini { align-self: flex-start; background: #9d4edd22; color: #e0c8ff; border: 1px solid #9d4edd77; border-radius: 8px; padding: .3rem .7rem; font: inherit; font-size: .75rem; cursor: pointer; }
.foot { text-align: center; font-size: .75rem; margin-top: 2rem; }
.detect {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 auto 16px;
	padding: 10px 16px;
	max-width: 520px;
	border: 1px solid rgba(0, 240, 255, 0.35);
	border-radius: 12px;
	background: rgba(0, 240, 255, 0.06);
	text-align: center;
}
.detect-l {
	font-size: 0.8rem;
	opacity: 0.7;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

html, body { background: #000 !important; background-image: none !important; }
.ff-panel, .res, .ring span { background: #000; }
.opt, .cta, .cta.alt, .mini { background: #fff !important; color: #000 !important; border-color: #fff !important; box-shadow: none !important; }
.opt small { color: #444; }
.opt.on { box-shadow: 0 0 0 3px var(--c), 0 0 14px #00f0ff88 !important; }
/* Tema monocromático */
:root { --p: #ffffff; --c: #ffffff; --accent: #ffffff; }
html, body { color: #ffffff !important; }
.ff-panel { background: #121212; border: 1px solid #ffffff55; box-shadow: 0 0 24px #ffffff14; }
.ff-tag { color: #fff; border-color: #ffffff66; }
.neon-p, .neon-c { color: #fff; text-shadow: 0 0 14px #ffffff88; }
.ff-sub, .ff-muted, .ff-label, .res-l, .detect-l, .foot { color: #a0a0a0; }
.detect { border-color: #ffffff55; background: #121212; }
.opt.on { box-shadow: 0 0 0 3px #000, 0 0 0 5px #fff, 0 0 16px #ffffffaa !important; }
.ring { background: conic-gradient(#fff calc(var(--p) * 1%), #2a2a2a 0); box-shadow: 0 0 26px #ffffff55; animation: blink 1s infinite; }
.ring span { background: #000; color: #fff; }
.bar { background: #222; }
.bar div { background: #fff; box-shadow: 0 0 12px #fff; animation: blink .8s infinite; }
.load-title { animation: blink 1s infinite; }
.console { margin-top: 1rem; text-align: left; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem;
	color: #fff; text-shadow: 0 0 8px #ffffffaa; background: #000; border: 1px solid #ffffff33; border-radius: 10px; padding: .6rem .8rem; min-height: 6.8rem; overflow: hidden; }
.console div { animation: rise .3s ease-out; }
.console div:last-child { animation: rise .3s ease-out, blink .7s infinite; }
@keyframes blink { 50% { opacity: .45; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.res, .res:last-child, .res.awm { background: #121212; border: 1px solid #ffffffcc; box-shadow: 0 0 10px #ffffff1a; }
.res-v { color: #fff; text-shadow: 0 0 10px #ffffff66; }
.res.wide {
	grid-column: 1 / -1;
}
.res.wide .res-v {
	font-size: 0.95rem;
	line-height: 1.5;
	word-break: break-word;
}
.regedit {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 14px 0;
	padding: 14px 16px;
	background: #121212;
	border: 1px solid rgba(255, 255, 255, 0.8);
	border-radius: 12px;
	color: #fff;
}
.regedit p {
	margin: 2px 0 0;
	color: #a0a0a0;
}
.regedit-dot {
	width: 10px;
	height: 10px;
	flex: none;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 10px #fff;
	animation: regblink 1s steps(2) infinite;
}
@keyframes regblink {
	50% {
		opacity: 0.2;
	}
}
.res-grid { display: flex !important; flex-direction: column; gap: 8px; }
.res-grid .res {
	display: flex !important; flex-direction: row !important; align-items: center; gap: 12px;
	background: #000 !important; padding: 12px 14px !important; text-align: left;
}
.res-grid .res .res-l { flex: 0 0 82px; color: #a0a0a0; font-size: 13px; }
.res-grid .res .res-v { flex: 0 0 auto; margin-left: auto; color: #fff; font-size: 22px; font-weight: 800; min-width: 40px; text-align: right; }
.res-grid .res.wide { flex-wrap: wrap; }
.res-grid .res.wide .res-v { font-size: 14px; flex: 1 1 100%; text-align: left; margin-left: 0; }
.res-bar { flex: 1; height: 8px; background: #1e1e1e; border-radius: 4px; overflow: hidden; border: 1px solid #333; }
.res-bar > span {
	display: block; height: 100%; background: #fff; box-shadow: 0 0 10px #fff;
	animation: barFill 1.1s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes barFill { from { width: 0 !important; } }
.opt:disabled:not(.on) {
	opacity: 0.35;
	cursor: not-allowed;
}
.opt.on:disabled {
	cursor: default;
}
.lock-note {
	margin: -4px 0 10px;
	font-size: 12px;
	color: #00f0ff;
	opacity: 0.8;
}
body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.shell {
	max-width: 42rem;
	margin: 0 auto;
	padding: calc(var(--space) * 3) var(--space);
}

h1 {
	margin: 0 0 0.5rem;
	font-size: clamp(1.6rem, 4vw, 2.25rem);
	letter-spacing: -0.02em;
}

.lede {
	margin: 0 0 0.75rem;
	font-size: 1.05rem;
}

.hint {
	margin: 0;
	color: var(--muted);
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 0.9rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}

.btn:hover {
	filter: brightness(1.05);
}

.btn-secondary {
	background: transparent;
	color: var(--fg);
	border-color: var(--border);
}

.card {
	padding: var(--space);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
}

.input,
.select,
.textarea {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	color: var(--fg);
	font: inherit;
}

.field {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.35rem;
	margin-bottom: var(--space);
}

.field > label {
	font-size: 0.875rem;
	color: var(--muted);
}

/*
 * 390px-safe, like .grid below. A grid with no column list gets one implicit
 * auto column, and an auto column is never narrower than its widest item's
 * min-content width. One nowrap scrolling strip (days, time slots) anywhere
 * inside an item therefore widened the whole column past the screen: the page
 * scrolled sideways instead of the strip scrolling on its own. minmax(0, 1fr)
 * caps the column at the container; the min-width rule keeps a child from
 * bringing the same floor back if an app redefines the columns. :where() adds
 * no specificity, so a min-width the app sets on a child still wins.
 */
.stack {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space);
}

:where(.field, .stack, .list) > * {
	min-width: 0;
}

.row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

/*
 * 390px-safe. An unclamped minmax track overflows a 390px viewport once the
 * shell padding is subtracted, and nothing in the pipeline ever looked at a
 * phone-width layout, so every generated app inherited the horizontal scroll.
 * min() clamps the track to the container instead.
 */
.grid {
	display: grid;
	gap: var(--space);
	grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}

.list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.table {
	width: 100%;
	border-collapse: collapse;
}

.table th,
.table td {
	padding: 0.6rem 0.5rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
}

.table th {
	font-size: 0.8125rem;
	color: var(--muted);
	font-weight: 600;
}

.empty {
	padding: calc(var(--space) * 2);
	text-align: center;
	color: var(--muted);
}

.empty-title {
	margin: 0 0 0.25rem;
	color: var(--fg);
	font-weight: 600;
}

/* Loading. Every fetch has one; without a primitive each app invented its own. */
.loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: calc(var(--space) * 1.5);
	color: var(--muted);
}

.spinner {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: fab-spin 0.7s linear infinite;
}

@keyframes fab-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Placeholder for content whose shape is known before its data arrives. */
.skeleton {
	display: block;
	height: 1rem;
	border-radius: calc(var(--radius) / 2);
	background: linear-gradient(90deg, var(--border), transparent, var(--border));
	background-size: 200% 100%;
	animation: fab-shimmer 1.2s linear infinite;
}

@keyframes fab-shimmer {
	to {
		background-position: -200% 0;
	}
}

/* Error strip: a failure the user can see and retry, never a silent no-op. */
.alert {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-left: 3px solid var(--muted);
	border-radius: var(--radius);
}

.alert-error {
	border-left-color: var(--danger);
	color: var(--danger);
}

.badge {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 0.8125rem;
	color: var(--muted);
}

/*
 * The scaffold had exactly one @media rule (prefers-color-scheme) and no width
 * breakpoint at all, so the shell was a 42rem column at every size.
 * Mobile-first stays the default; these only widen it.
 */
@media (min-width: 48rem) {
	.shell {
		max-width: 52rem;
		padding: calc(var(--space) * 3) calc(var(--space) * 1.5);
	}
}

@media (min-width: 64rem) {
	.shell {
		max-width: 64rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.spinner,
	.skeleton {
		animation: none;
	}
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
