.pomodoro-widget {
	width: 100%;
	margin: 24px auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}
.pomodoro-widget * {
	box-sizing: border-box;
}
.pomodoro-login-required {
	max-width: 480px;
	margin: 24px auto;
	padding: 20px;
	text-align: center;
	background: #fff8e1;
	border: 1px solid #ffe082;
	border-radius: 12px;
	color: #795548;
}

.pm-card {
	max-width: 480px;
	margin: 0 auto;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	padding: 24px 24px 28px;
	text-align: center;
	border: 1px solid #eee;
	position: relative;
}
.pm-top-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.pm-top-actions {
	display: flex;
	gap: 8px;
}
.pm-mode-label {
	display: inline-block;
	padding: 6px 16px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: background-color .3s, color .3s;
}
.pm-mode-study { background: #ffe3ea; color: #d1195f; }
.pm-mode-break { background: #d9f9ef; color: #0a8f6c; }

.pm-dots-btn, .pm-history-btn {
	background: #f1f1f1;
	border: none;
	border-radius: 8px;
	width: 32px;
	height: 32px;
	font-size: 15px;
	line-height: 1;
	color: #555;
	cursor: pointer;
}
.pm-dots-btn:hover, .pm-history-btn:hover { background: #e4e4e4; }

.pm-settings {
	display: none;
	justify-content: center;
	gap: 20px;
	margin-bottom: 16px;
	flex-wrap: wrap;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 14px;
}
.pm-settings.pm-settings-open { display: flex; }
.pm-settings label {
	display: flex;
	flex-direction: column;
	font-size: 12px;
	color: #666;
	gap: 4px;
	text-align: left;
}
.pm-settings input {
	width: 80px;
	padding: 6px 8px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
}

.pm-subject-row {
	margin-bottom: 14px;
	transition: opacity .2s;
}
.pm-subject-row.pm-hidden {
	opacity: .35;
	pointer-events: none;
}
.pm-subject-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 10px;
	font-size: 14px;
	text-align: center;
}

.pm-time {
	font-size: 56px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #222;
	margin-bottom: 18px;
	font-variant-numeric: tabular-nums;
}
.pm-controls {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}
.pm-btn {
	border: none;
	border-radius: 10px;
	padding: 12px 36px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .15s, opacity .15s;
}
.pm-btn-toggle { background: #2a9d8f; color: #fff; }
.pm-btn-toggle:hover { background: #248a7e; }
.pm-btn-toggle.pm-is-running { background: #f4a261; }
.pm-btn-toggle.pm-is-running:hover { background: #e8934c; }

.pm-btn-secondary {
	background: #f1f1f1;
	color: #444;
	padding: 12px 18px;
	font-size: 13px;
}
.pm-btn-secondary:hover { background: #e4e4e4; }

.pm-summary {
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
}
.pm-badge {
	font-size: 12px;
	padding: 6px 10px;
	border-radius: 8px;
	background: #f7f7f7;
	color: #444;
}
.pm-badge-study { background: #ffe3ea; color: #d1195f; }
.pm-badge-break { background: #d9f9ef; color: #0a8f6c; }
.pm-badge-idle  { background: #eceff1; color: #546e7a; }

.pm-timeline-full-wrap {
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	margin-top: 20px;
	padding: 0 20px;
}
.pm-timeline-outer { margin-top: 8px; }
.pm-timeline {
	position: relative;
	width: 100%;
	height: 34px;
	background: repeating-linear-gradient(90deg, #fafafa, #fafafa 8px, #f2f2f2 8px, #f2f2f2 16px);
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #eee;
}
.pm-seg { position: absolute; top: 0; bottom: 0; min-width: 2px; }
.pm-seg-study { background: #ef476f; }
.pm-seg-break { background: #06d6a0; }
.pm-seg-idle  { background: #b0bec5; }

.pm-timeline-hours {
	position: relative;
	width: 100%;
	height: 16px;
	margin-top: 4px;
}
.pm-hour-label {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	font-size: 10px;
	color: #999;
	white-space: nowrap;
}
.pm-legend {
	display: flex;
	justify-content: center;
	gap: 16px;
	margin-top: 12px;
	flex-wrap: wrap;
}
.pm-legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #666;
}
.pm-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pm-dot-study { background: #ef476f; }
.pm-dot-break { background: #06d6a0; }
.pm-dot-idle  { background: #b0bec5; }

/* Modal d'historial */
.pm-history-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.pm-history-modal[hidden] { display: none; }
.pm-history-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}
.pm-history-box {
	position: relative;
	background: #fff;
	border-radius: 16px;
	padding: 24px;
	max-width: 640px;
	width: 92%;
	max-height: 85vh;
	overflow: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.pm-history-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	gap: 12px;
}
.pm-history-date {
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
}
.pm-history-close {
	background: #f1f1f1;
	border: none;
	border-radius: 8px;
	width: 32px;
	height: 32px;
	font-size: 18px;
	cursor: pointer;
	color: #555;
}
.pm-history-close:hover { background: #e4e4e4; }
.pm-history-timeline-outer { margin-bottom: 16px; }
.pm-history-timeline {
	position: relative;
	width: 100%;
	height: 34px;
	background: repeating-linear-gradient(90deg, #fafafa, #fafafa 8px, #f2f2f2 8px, #f2f2f2 16px);
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #eee;
}
.pm-history-timeline-hours {
	position: relative;
	width: 100%;
	height: 16px;
	margin-top: 4px;
}
.pm-history-subjects {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 16px;
}
.pm-history-subject-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 13px;
}
.pm-history-empty {
	color: #888;
	font-size: 13px;
	text-align: center;
	padding: 20px 0;
}
