:root {
	--bg: #402d20;
	--bg-2: #664833;
	--paper: #4e3828;
	--text: #faf7ed;
	--muted: #d9d6ce;
	--line: rgba(250, 247, 237, .14);
	--accent: #ff793f;
	--accent-2: #ffb142;
	--red: #c0392b;
	--hold: #c47b2b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
	margin: 0;
	font-family: -apple-system, "Segoe UI", sans-serif;
	background: var(--bg);
	color: var(--text);
}
button, input, textarea { font: inherit; color: inherit; }
.login {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.login-card, .panel, .card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 18px;
}
.login-card { width: min(420px, 100%); padding: 32px; }
.login-card h1, .side h1, .card strong, h2 { font-family: Georgia, serif; font-weight: 560; }
.login-card h1 { margin: 0 0 8px; }
#login-error { color: #ffb142; min-height: 1.2em; }
.login-card p { color: var(--muted); }
label { display: block; margin: 14px 0; font-size: 14px; }
input, textarea {
	width: 100%;
	margin-top: 6px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: var(--bg-2);
}
textarea { min-height: 180px; resize: vertical; }
.btn {
	border: 0;
	border-radius: 999px;
	padding: 12px 18px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	cursor: pointer;
	font-weight: 650;
}
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
	padding: 24px 16px;
	border-right: 1px solid var(--line);
	background: #342418;
}
.side h1 { font-size: 28px; margin: 0 0 24px; }
.side button {
	display: block;
	width: 100%;
	text-align: left;
	margin-bottom: 6px;
	padding: 12px 14px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	cursor: pointer;
}
.side button.active { background: rgba(255, 121, 63, .18); box-shadow: inset 3px 0 0 var(--accent); }
.main { padding: 28px; }
.panel { display: none; padding: 22px; }
.panel.active { display: block; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { padding: 16px; }
.card strong { display: block; font-size: 32px; }
.booking h3 { margin: 22px 0 8px; }
.pill { display: inline-block; margin: 6px 0 0 8px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 177, 66, .18); color: var(--accent-2); font-size: 13px; }
.cal-bar, .row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.week, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week { color: var(--muted); text-align: center; margin: 12px 0; font-size: 13px; }
.cal-week { margin-bottom: 8px; overflow: visible; }
.cal-days { position: relative; overflow: visible; }
.cal-days .day {
	grid-row: 1;
	align-self: stretch;
	min-height: 58px;
	border: 0;
	border-radius: 8px;
	background: linear-gradient(to bottom right, #5a3f2e 50%, #664833 50%);
	cursor: pointer;
	z-index: 1;
}
.day-num {
	grid-row: 1;
	align-self: start;
	justify-self: center;
	z-index: 4;
	pointer-events: none;
	padding-top: 3px;
	font-size: 12px;
	font-weight: 750;
	text-shadow: 0 1px 2px rgba(20, 8, 4, .9);
}
.stay {
	grid-row: 1;
	align-self: stretch;
	z-index: 2;
	width: 100%;
	min-width: 0;
	display: flex;
	align-items: center;
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
	color: #fff;
	text-align: left;
	cursor: pointer;
	overflow: hidden;
}
.stay-line {
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	line-height: 1.15;
	text-shadow: 0 1px 2px rgba(20, 8, 4, .85);
}
.stay-line strong {
	font-size: 12px;
	font-weight: 750;
	white-space: nowrap;
	overflow: hidden;
}
.stay-meta {
	display: flex;
	justify-content: space-between;
	gap: 6px;
	min-width: 0;
	font-size: 10px;
	font-weight: 650;
	white-space: nowrap;
}
.stay-meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stay-meta span:last-child { flex-shrink: 0; }
.hint, #notify-state, #cal-who { color: var(--accent-2); }
.month-list { list-style: none; margin: 14px 0 4px; padding: 0; }
.month-list li {
	display: grid;
	grid-template-columns: minmax(108px, 132px) 1fr;
	gap: 6px 10px;
	align-items: start;
	padding: 7px 0;
	border-bottom: 1px solid var(--line);
}
.month-when { color: var(--muted); font-size: 14px; padding-top: 2px; }
.month-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.month-who.is-free, .month-who .is-free { color: var(--muted); }
.month-stay {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 8px;
	align-items: baseline;
	width: 100%;
	border: 0;
	border-left: 4px solid var(--stay, var(--accent-2));
	background: transparent;
	padding: 1px 0 1px 8px;
	text-align: left;
	cursor: pointer;
}
.month-stay strong { font-size: 15px; font-weight: 700; }
.month-stay span { color: var(--muted); font-size: 13px; }
.week-block { margin: 8px 0 16px; }
.week-block h3 { margin: 14px 0 6px; font-size: 16px; }
.week-block li { margin: 4px 0; }
.phone-bar, .tabbar { display: none; }
.sheet-back {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(20, 12, 8, .72);
}
.sheet {
	width: min(560px, 100%);
	max-height: min(86vh, 720px);
	overflow: auto;
	background: var(--paper);
	border-radius: 18px 18px 0 0;
	padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
}
#stay-title { margin-top: 12px; }
#cal-who { color: var(--accent-2); }
.booking { padding: 14px 0; border-bottom: 1px solid var(--line); }
.stay-edit { margin: 12px 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
#new-booking { margin-bottom: 18px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.stay-edit h3 { margin: 0 0 6px; }
.stay-edit label { margin: 8px 0; }
.stay-edit textarea { min-height: 64px; }
.btn.warn { background: transparent; border: 1px solid #c0392b; color: #ffb142; }
.booking p { margin: 4px 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mail-block { margin-bottom: 22px; }
@media (min-width: 801px) {
	.sheet-back { align-items: center; padding: 24px; }
	.sheet { border-radius: 18px; }
}
@media (max-width: 800px) {
	.shell { display: block; }
	.side { display: none; }
	.cards { grid-template-columns: 1fr 1fr; }
	.main { padding: 12px 12px calc(88px + env(safe-area-inset-bottom)); }
	.panel { padding: 16px; }
	.phone-bar {
		display: flex;
		justify-content: space-between;
		align-items: center;
		position: sticky;
		top: 0;
		z-index: 15;
		padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
		background: #342418;
	}
	.phone-bar strong { font-family: Georgia, serif; font-size: 22px; }
	.phone-bar button {
		border: 0;
		background: transparent;
		color: var(--muted);
		min-height: 44px;
		padding: 8px;
	}
	.tabbar {
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 20;
		background: #342418;
		border-top: 1px solid var(--line);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.tabbar button {
		border: 0;
		background: transparent;
		color: var(--muted);
		font-size: 11px;
		min-height: 52px;
		padding: 8px 2px;
	}
	.tabbar button.active { color: var(--accent-2); }
	.month-list li { grid-template-columns: 1fr; gap: 2px; }
}
