/* Totality Holidays: front end */
.th-app {
	--th-ink: #1d2626;
	--th-muted: #66706f;
	--th-line: #dfe3e2;
	--th-soft: #f5f7f6;
	--th-accent: #1f6f6b;
	--th-accent-ink: #ffffff;
	--th-ok-bg: #e8f5ee;
	--th-ok-ink: #1c5e3a;
	--th-err-bg: #fcebea;
	--th-err-ink: #8a2a22;
	--th-bank: #8a5a00;
	color: var(--th-ink);
	font-size: 16px;
	line-height: 1.5;
	max-width: 1200px;
	margin: 0 auto;
	box-sizing: border-box;
}
.th-app *, .th-app *::before, .th-app *::after { box-sizing: border-box; }

.th-card {
	background: #fff;
	border: 1px solid var(--th-line);
	border-radius: 10px;
	padding: 24px;
	margin: 0 0 24px;
}
.th-title { font-size: 1.3em; margin: 0 0 12px; padding: 0; line-height: 1.3; }
.th-muted { color: var(--th-muted); }
.th-small { font-size: 0.875em; }

/* Notices */
.th-notice { padding: 12px 16px; border-radius: 8px; margin: 0 0 20px; font-weight: 600; }
.th-notice--success { background: var(--th-ok-bg); color: var(--th-ok-ink); }
.th-notice--error { background: var(--th-err-bg); color: var(--th-err-ink); }

/* Forms */
.th-form { display: grid; gap: 14px; }
.th-label { display: block; font-weight: 600; margin: 0 0 4px; font-size: 0.95em; }
.th-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #b9c1c0;
	border-radius: 6px;
	font: inherit;
	background: #fff;
	color: inherit;
}
.th-input:focus { outline: 2px solid var(--th-accent); outline-offset: 1px; border-color: var(--th-accent); }
.th-button {
	background: var(--th-accent);
	color: var(--th-accent-ink);
	border: 0;
	border-radius: 6px;
	padding: 12px 20px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	justify-self: start;
}
.th-button:hover, .th-button:focus { filter: brightness(1.1); }
.th-button:disabled { opacity: 0.6; cursor: default; }
.th-link-button {
	background: none;
	border: 0;
	padding: 0;
	color: var(--th-accent);
	text-decoration: underline;
	font: inherit;
	cursor: pointer;
}
.th-type { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.th-type legend { width: 100%; }
.th-type label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.th-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.th-fields[hidden] { display: none; }

/* Login */
.th-login { max-width: 460px; margin: 40px auto; }

/* Top bar */
.th-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 16px; }
.th-bar form { margin: 0; }
.th-hello { margin: 0; }

/* Calendar */
.th-cal-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.th-cal-head .th-title { margin: 0; min-width: 9em; text-align: center; }
.th-nav {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: 50%;
	border: 1px solid var(--th-line); text-decoration: none; color: var(--th-ink);
	font-size: 22px; line-height: 1;
}
.th-nav:hover { background: var(--th-soft); }
.th-today-link { margin-left: auto; color: var(--th-accent); }

.th-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	border-top: 1px solid var(--th-line);
	border-left: 1px solid var(--th-line);
}
.th-dow {
	padding: 8px;
	font-size: 0.8em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--th-muted);
	background: var(--th-soft);
	border-right: 1px solid var(--th-line);
	border-bottom: 1px solid var(--th-line);
}
.th-day {
	min-height: 110px;
	padding: 6px;
	border-right: 1px solid var(--th-line);
	border-bottom: 1px solid var(--th-line);
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.th-day.is-weekend { background: var(--th-soft); }
.th-day.is-other { opacity: 0.45; }
.th-day.is-bank { background: #fff8e8; }
.th-date { font-weight: 700; font-size: 0.9em; }
.th-date-long { display: none; }
.th-day.is-today .th-date-short {
	background: var(--th-accent);
	color: var(--th-accent-ink);
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	width: 26px; height: 26px;
}
.th-bank { font-size: 0.75em; color: var(--th-bank); font-weight: 600; line-height: 1.25; }
.th-chip {
	font-size: 0.78em;
	line-height: 1.3;
	padding: 3px 6px;
	border-radius: 4px;
	color: #fff;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.th-half { opacity: 0.9; font-weight: 400; }
.th-c0 { background: #1f6f6b; }
.th-c1 { background: #3d5a99; }
.th-c2 { background: #9a4a2c; }
.th-c3 { background: #6b4c93; }
.th-c4 { background: #2f7d3b; }
.th-c5 { background: #a33a5c; }
.th-c6 { background: #4f6470; }
.th-c7 { background: #8a6d10; }

.th-empty-month { margin: 12px 0 0; }

/* Lower columns */
.th-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.th-columns .th-card { margin: 0; }
.th-mine .th-title + .th-table { margin-top: 0; }
.th-mine .th-title:not(:first-child) { margin-top: 24px; }

.th-table { width: 100%; border-collapse: collapse; margin: 0 0 8px; }
.th-table th, .th-table td { padding: 8px 10px; border-bottom: 1px solid var(--th-line); text-align: right; }
.th-table th:first-child { text-align: left; font-weight: 400; color: var(--th-muted); }
.th-table thead th { font-weight: 700; color: var(--th-ink); }
.th-table tr.is-total th, .th-table tr.is-total td { font-weight: 700; color: var(--th-ink); border-bottom: 0; }

.th-list { list-style: none; margin: 0; padding: 0; }
.th-list li {
	display: flex; justify-content: space-between; align-items: center; gap: 12px;
	padding: 10px 0; border-bottom: 1px solid var(--th-line);
}
.th-list li:last-child { border-bottom: 0; }
.th-list li > div { display: flex; flex-direction: column; }
.th-list form { margin: 0; }

/* Tablet */
@media (max-width: 900px) {
	.th-columns { grid-template-columns: 1fr; }
	.th-day { min-height: 90px; }
}

/* Mobile: calendar becomes a list of days */
@media (max-width: 640px) {
	.th-card { padding: 16px; }
	.th-fields { grid-template-columns: 1fr; }
	.th-grid { display: block; border: 0; }
	.th-dow, .th-day.is-other, .th-day.is-empty { display: none; }
	.th-day {
		min-height: 0;
		border: 1px solid var(--th-line);
		border-radius: 8px;
		margin: 0 0 8px;
		padding: 10px 12px;
	}
	.th-date-short { display: none; }
	.th-date-long { display: inline; }
	.th-day.is-today { border-color: var(--th-accent); border-width: 2px; }
	.th-chip { font-size: 0.9em; white-space: normal; }
	.th-cal-head .th-title { min-width: 0; flex: 1; }
}

.th-nav.is-disabled { opacity: 0.3; cursor: default; }
.th-nav.is-disabled:hover { background: none; }
