/* ---- theme tokens ---- */
.theme-cycle {
	--bg: #241627;
	--accent: #ee9cb2;
	--accent2: #9d8ce8;
	--text: #f3eaf1;
	--muted: rgba(243, 234, 241, 0.55);
	--border: rgba(243, 234, 241, 0.12);
	--card-bg: rgba(243, 234, 241, 0.04);

	--panel: #312036;
	--panel-2: #3a2741;
	--rose: #ee9cb2;
	--bloom: #c8f09b;
	--gold: #f4c95d;
	--dusk: #9d8ce8;
	--ink: #f3eaf1;
	--ink-dim: #b9a6bb;
	--line: rgba(243, 234, 241, 0.12);
	--radius: 18px;

	line-height: 1.55;
}

/* ---- layout ---- */
.cycle-wrap {
	max-width: 880px;
	margin: 0 auto;
	padding: 110px 16px 80px;
}

.cycle-wrap header {
	text-align: center;
	margin-bottom: 28px;
}

.cycle-wrap header h1 {
	font-family: "Pacifico", cursive;
	font-size: clamp(1.8rem, 4.5vw, 2.8rem);
	color: var(--ink);
	font-weight: 400;
}

.cycle-wrap header p {
	color: var(--ink-dim);
	font-size: 0.95rem;
	margin-top: 8px;
}

/* ---- tracker cards ---- */
.tracker-card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
	margin-bottom: 18px;
}

.tracker-card h2 {
	font-family: "Dongle", sans-serif;
	font-size: 1.8rem;
	font-weight: 400;
	line-height: 1.1;
	margin-bottom: 12px;
	color: var(--ink);
}

/* ---- cycle wheel ---- */
.wheel-card {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: center;
	justify-content: center;
}

.wheel-box {
	position: relative;
	width: min(300px, 80vw);
}

.wheel-box svg {
	width: 100%;
	height: auto;
	display: block;
}

.wheel-center {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	pointer-events: none;
}

.wheel-center .day-num {
	font-family: "Dongle", sans-serif;
	font-size: 3.2rem;
	font-weight: 400;
	line-height: 1;
	color: var(--ink);
}

.wheel-center .day-label {
	color: var(--ink-dim);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	margin-top: 2px;
}

.phase-info {
	flex: 1;
	min-width: 240px;
	max-width: 380px;
}

.phase-chip {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.8rem;
	color: #241627;
	margin-bottom: 10px;
}

.phase-info h3 {
	font-family: "Dongle", sans-serif;
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.2;
	margin-bottom: 6px;
	color: var(--ink);
}

.phase-info p {
	color: var(--ink-dim);
	font-size: 0.95rem;
	margin-bottom: 10px;
}

.feel-list {
	list-style: none;
}

.feel-list li {
	padding: 6px 0 6px 22px;
	position: relative;
	font-size: 0.95rem;
	color: var(--ink);
}

.feel-list li::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 14px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.7;
}

.disclaimer {
	font-size: 0.8rem;
	color: var(--ink-dim);
	margin-top: 12px;
	font-style: italic;
}

/* ---- predictions ---- */
.pred-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
}

.pred {
	background: var(--panel-2);
	border-radius: 14px;
	padding: 14px;
	text-align: center;
}

.pred .big {
	font-family: "Dongle", sans-serif;
	font-size: 1.5rem;
	font-weight: 400;
	margin-top: 2px;
	color: var(--ink);
}

.pred .lbl {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--ink-dim);
}

.pred .meta {
	color: var(--ink-dim);
	font-size: 0.8rem;
}

/* ---- forms / buttons ---- */
.cycle-wrap label {
	display: block;
	font-size: 0.85rem;
	color: var(--ink-dim);
	margin: 10px 0 4px;
}

.cycle-wrap input[type="date"],
.cycle-wrap input[type="number"] {
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: var(--bg);
	color: var(--ink);
	font-family: inherit;
	font-size: 1rem;
}

.cycle-wrap input:focus {
	outline: 2px solid var(--rose);
	outline-offset: 2px;
}

.cycle-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.cycle-row > div {
	flex: 1;
	min-width: 140px;
}

.cycle-btn {
	margin-top: 14px;
	padding: 11px 20px;
	border: none;
	border-radius: 999px;
	background: var(--rose);
	color: #241627;
	font-weight: 700;
	font-size: 0.95rem;
	font-family: inherit;
	cursor: pointer;
	transition:
		transform 0.12s ease,
		opacity 0.12s;
}

.cycle-btn:hover {
	transform: translateY(-1px);
}

.cycle-btn.ghost {
	background: transparent;
	color: var(--ink);
	border: 1px solid var(--line);
}

.cycle-btn.danger {
	background: transparent;
	color: var(--rose);
	border: 1px solid var(--rose);
	padding: 6px 14px;
	font-size: 0.8rem;
	margin: 0;
}

/* ---- history ---- */
.history-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
}

.history-item:last-child {
	border-bottom: none;
}

.history-item .when {
	font-weight: 700;
	color: var(--ink);
}

.history-item .meta {
	color: var(--ink-dim);
	font-size: 0.85rem;
}

.cycle-empty {
	color: var(--ink-dim);
	font-style: italic;
}

/* ---- sync section ---- */
.sync-intro {
	color: var(--ink-dim);
	font-size: 0.9rem;
	margin-bottom: 16px;
	line-height: 1.6;
}

.sync-steps {
	list-style: none;
	margin-bottom: 18px;
}

.sync-steps li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 8px 0;
	font-size: 0.9rem;
	color: var(--ink-dim);
	border-bottom: 1px solid var(--line);
}

.sync-steps li:last-child {
	border-bottom: none;
}

.sync-step-num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	min-width: 22px;
	border-radius: 50%;
	background: var(--rose);
	color: #241627;
	font-size: 0.7rem;
	font-weight: 700;
	margin-top: 1px;
}

.sync-divider {
	height: 1px;
	background: var(--line);
	margin: 18px 0;
}

.sync-fallback-label {
	font-size: 0.8rem;
	color: var(--ink-dim);
	margin-bottom: 8px;
}

.sync-fallback-textarea {
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: var(--bg);
	color: var(--ink);
	font-family: inherit;
	font-size: 0.8rem;
	min-height: 60px;
	resize: vertical;
	word-break: break-all;
}

.sync-fallback-textarea:focus {
	outline: 2px solid var(--rose);
	outline-offset: 2px;
}

/* ---- toast ---- */
.cycle-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%) translateY(80px);
	background: var(--rose);
	color: #241627;
	font-weight: 700;
	padding: 10px 22px;
	border-radius: 999px;
	transition: transform 0.25s ease;
	z-index: 10;
}

.cycle-toast.show {
	transform: translateX(-50%) translateY(0);
}

@media (max-width: 520px) {
	.cycle-wrap {
		padding: 90px 12px 60px;
	}

	.tracker-card {
		padding: 16px;
		overflow: hidden;
	}

	/* wheel + phase info: stack vertically so text isn't squeezed */
	.wheel-card {
		flex-direction: column;
		align-items: center;
	}

	.wheel-box {
		width: min(240px, 70vw);
	}

	.phase-info {
		min-width: 0;
		width: 100%;
		max-width: 100%;
	}

	/* stack the date + length inputs vertically */
	.cycle-row {
		flex-direction: column;
		gap: 0;
	}

	.cycle-row > div {
		min-width: 0;
		width: 100%;
		overflow: hidden;
	}

	/* fix iOS Safari date input overflowing its container */
	.cycle-wrap input[type="date"],
	.cycle-wrap input[type="number"] {
		max-width: 100%;
		width: 100%;
		-webkit-appearance: none;
		appearance: none;
	}

	/* predictions grid: 2 columns max on small screens */
	.pred-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	/* history row: keep button from squishing text */
	.history-item {
		flex-wrap: wrap;
		gap: 8px;
	}

	/* buttons full-width on mobile */
	.cycle-btn:not(.danger):not(.ghost) {
		width: 100%;
		text-align: center;
	}
}

@media (max-width: 360px) {
	.pred-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
