:root {
	--v2-masthead-h: 54px;
}

.v2-shell {
	max-width: 1520px;
	padding: 14px;
	overflow: visible;
}

.v2-masthead {
	font-size: 13px;
	position: relative;
	z-index: 120;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-areas: "left center right";
	align-items: center;
	gap: 12px;
	min-height: var(--v2-masthead-h);
	padding: 8px 10px;
	border: 1px solid var(--v2-border);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.78);
	box-shadow: var(--v2-shadow);
	backdrop-filter: blur(14px);
}

.v2-masthead-left {
	grid-area: left;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.v2-masthead-center {
	grid-area: center;
	min-width: 0;
	justify-self: stretch;
}

.v2-masthead-right {
	grid-area: right;
	display: inline-flex;
	align-items: center;
	justify-self: end;
	gap: 8px;
	min-width: 0;
}

.v2-brand {
	display: inline-flex;
	align-items: center;
	min-width: 0;
}

.v2-brand img {
	width: 112px;
	opacity: 0.92;
}

.v2-identity {
	min-width: 0;
	flex: 0 1 auto;
}

.v2-identity strong {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 0.86rem;
}

.v2-identity--abbr {
	display: none;
}

.v2-identity-badge {
	display: inline-flex;
	align-items: center;
	margin-top: 3px;
	padding: 2px 7px;
	border-radius: 999px;
	background: rgba(36, 70, 107, 0.08);
	color: #36567e;
	font-size: 0.67rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.v2-masthead-calendar {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
	max-width: 100%;
}

.v2-masthead-calendar .v2-toolbar-group--center {
	justify-self: auto;
}

.v2-masthead-calendar-key {
	flex: 0 0 auto;
}

.v2-public-masthead,
.v2-auth-masthead {
	margin-bottom: 14px;
}

.v2-public-identity,
.v2-auth-identity {
	display: grid;
	gap: 2px;
}

.v2-public-identity .v2-identity-badge,
.v2-auth-identity .v2-identity-badge {
	margin-top: 0;
	justify-self: start;
	width: fit-content;
	max-width: min(58ch, 56vw);
}

.v2-public-actions,
.v2-auth-actions {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.v2-public-meta,
.v2-auth-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	font-size: 10px;
	color: #5f6f82;
}

.v2-public-meta span,
.v2-auth-meta span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 8px;
	border: 1px solid var(--v2-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.9);
}

.v2-settings {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: max-content;
	margin-left: 0;
	z-index: 130;
}

.v2-status-toggle {
	margin-top: 8px;
}

.v2-status-toggle__summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border: 1px solid var(--v2-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.82);
	color: var(--v2-brand);
	font-size: 0.74rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.v2-status-toggle__summary::-webkit-details-marker {
	display: none;
}

.v2-status-toggle__summary::before {
	content: "+";
	font-size: 0.9rem;
	line-height: 1;
}

.v2-status-toggle[open] .v2-status-toggle__summary::before {
	content: "-";
}

.v2-status-toggle .v2-status {
	margin-top: 8px;
}

.v2-quick-entry {
	width: min(420px, 38vw);
	min-width: 240px;
	height: 34px;
	padding: 0 13px;
	border: 1px solid var(--v2-border);
	border-radius: 999px;
	background: #fff;
	color: var(--v2-text);
	font: inherit;
	font-size: 0.76rem;
}

.v2-quick-entry::placeholder {
	color: var(--v2-muted);
}

.v2-icon-button,
.v2-top-link,
.v2-settings-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid var(--v2-border);
	border-radius: 999px;
	background: #fff;
	color: var(--v2-brand);
	text-decoration: none;
	font: inherit;
	cursor: pointer;
}

.v2-settings-trigger--label {
	min-width: 132px;
	width: auto;
	padding: 0 12px;
	gap: 8px;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.v2-top-link {
	width: auto;
	padding: 0 12px;
	font-size: 0.78rem;
	font-weight: 700;
}

.v2-icon-button svg,
.v2-settings-trigger svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	stroke-width: 1.8;
	fill: none;
}

.v2-settings-trigger--label svg {
	width: 15px;
	height: 15px;
	flex: 0 0 auto;
}

.v2-settings-trigger--label span {
	white-space: nowrap;
}

.v2-quick-entry-modal {
	position: fixed;
	inset: 0;
	z-index: 220;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 18px;
	background: rgba(19, 27, 39, 0.5);
	backdrop-filter: blur(8px);
}

.v2-quick-entry-modal.is-open {
	display: flex;
}

.v2-quick-entry-dialog {
	width: min(720px, 96vw);
	max-height: min(84vh, 760px);
	overflow: auto;
	padding: 18px;
	border: 1px solid var(--v2-border);
	border-radius: 20px;
	background: #fffdf8;
	box-shadow: 0 24px 60px rgba(19, 27, 39, 0.22);
}

.v2-quick-entry-dialog h2,
.v2-quick-entry-dialog h3 {
	margin: 0 0 10px;
}

.v2-quick-entry-dialog h3 {
	margin-top: 16px;
	font-size: 0.9rem;
	color: var(--v2-brand);
}

.v2-quick-entry-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 14px;
}

.v2-quick-entry-item strong {
	display: block;
	margin-bottom: 2px;
	font-size: 0.73rem;
	color: #596a80;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.v2-quick-entry-item span,
.v2-quick-entry-dialog li,
.v2-quick-entry-dialog p {
	font-size: 0.85rem;
	line-height: 1.45;
}

.v2-quick-entry-dialog ul {
	margin: 8px 0 0;
	padding-left: 18px;
}

.v2-workspace {
	display: grid;
	grid-template-columns: minmax(286px, 332px) minmax(0, 1fr);
	gap: 4px;
	margin-top: 2px;
	align-items: start;
}

.v2-workspace--single-column {
	grid-template-columns: minmax(0, 1fr);
}

.v2-panel {
	border: 1px solid var(--v2-border);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.84);
	box-shadow: var(--v2-shadow);
	backdrop-filter: blur(14px);
	overflow: hidden;
	min-height: 0;
}

.v2-panel-content {
	min-height: 0;
}

.v2-panel-body {
	flex: 1 1 auto;
	min-height: 0;
}

.v2-panel-inline-actions {
	display: flex;
	justify-content: flex-end;
	padding: 10px 10px 0;
	flex: 0 0 auto;
}

.v2-sidebar-frame,
.v2-main-frame,
.v2-calendar-frame {
	display: flex;
	flex-direction: column;
	min-height: 0;
	height: calc(100vh - 28px - var(--v2-masthead-h));
}

.v2-main-frame,
.v2-calendar-frame {
	align-self: stretch;
}

.v2-sidebar-frame .v2-panel-content,
.v2-main-frame .v2-panel-content,
.v2-calendar-frame .v2-panel-content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.v2-sidebar-frame .v2-panel-content {
	overflow: hidden;
}

.v2-modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 12px;
	background: rgba(15, 23, 42, 0.28);
	backdrop-filter: blur(10px);
	overflow: auto;
	z-index: 300;
}

.v2-modal.is-open {
	display: flex;
}

.v2-modal-dialog {
	display: flex;
	flex-direction: column;
	width: min(1040px, 100%);
	height: min(94vh, 980px);
	max-height: calc(100vh - 12px);
	border: 1px solid rgba(255, 255, 255, 0.48);
	border-radius: 28px;
	background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(246,249,253,0.96) 100%);
	box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
	overflow: hidden;
}

.v2-modal-head {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--v2-border);
	background: rgba(255, 255, 255, 0.88);
}

.v2-modal-title {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--v2-brand);
}

.v2-modal-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--v2-border);
	border-radius: 999px;
	background: #fff;
	color: var(--v2-brand);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}

.v2-modal-frame {
	flex: 1 1 auto;
	height: 0;
	display: block;
	width: 100%;
	min-height: 0;
	border: 0;
	background: #fff;
}

@media (max-width: 1120px) {
	.v2-identity--full {
		display: none;
	}

	.v2-identity--abbr {
		display: block;
	}

	.v2-quick-entry {
		width: min(320px, 32vw);
		min-width: 180px;
	}

	.v2-quick-entry-grid {
		grid-template-columns: 1fr;
	}

	.v2-masthead-calendar-key {
		display: none;
	}
}

@media (max-width: 768px) {
	.v2-masthead {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"left right"
			"center center";
		align-items: center;
	}

	.v2-masthead-left {
		gap: 10px;
	}

	.v2-masthead-center {
		width: 100%;
		justify-self: center;
	}

	.v2-masthead-calendar {
		width: auto;
		max-width: 100%;
	}

	.v2-public-meta,
	.v2-auth-meta {
		display: none;
	}
}

@media (max-width: 980px) {
	.v2-workspace {
		grid-template-columns: 1fr;
	}

	.v2-main-frame,
	.v2-calendar-frame {
		order: 1;
		height: calc(100vh - 28px - var(--v2-masthead-h));
		min-height: 0;
	}

	.v2-sidebar-frame {
		order: 2;
		height: 620px;
		min-height: 0;
		overflow: hidden;
	}

	.v2-workspace--settings .v2-sidebar-frame {
		display: none;
	}

	.v2-workspace--settings .v2-calendar-frame {
		order: 1;
		height: auto;
		min-height: calc(100vh - 28px - var(--v2-masthead-h));
	}
}

@media (max-width: 640px) {
	.v2-shell {
		padding: 0;
	}

	.v2-masthead {
		gap: 8px;
		padding: 8px;
		border-radius: 0;
	}

	.v2-masthead-left {
		gap: 8px;
	}

	.v2-masthead-calendar {
		width: 100%;
		justify-content: flex-start;
	}

	.v2-masthead-calendar .v2-toolbar-group {
		flex-wrap: wrap;
		gap: 4px;
	}

	.v2-toolbar-group--center,
	.v2-toolbar-group--end {
		justify-self: start;
	}

	.v2-public-actions,
	.v2-auth-actions {
		width: 100%;
	}

	.v2-public-identity,
	.v2-auth-identity {
		flex: 1 1 auto;
		min-width: 0;
	}

	.v2-public-identity .v2-identity-badge,
	.v2-auth-identity .v2-identity-badge {
		max-width: calc(100vw - 124px);
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.v2-sidebar-frame {
		height: 520px;
		min-height: 520px;
	}

	.v2-modal-dialog {
		width: min(96vw, 1040px);
		height: min(94vh, 980px);
		max-height: calc(100vh - 16px);
		height: calc(100dvh - 16px);
		max-height: calc(100dvh - 16px);
		height: calc(var(--v2-modal-viewport-height, 100dvh) - 16px);
		max-height: calc(var(--v2-modal-viewport-height, 100dvh) - 16px);
		border-radius: 22px;
	}

	.v2-modal {
		top: var(--v2-modal-viewport-top, 0px);
		bottom: auto;
		height: 100vh;
		height: var(--v2-modal-viewport-height, 100dvh);
		padding: 8px;
		overflow: hidden;
		overscroll-behavior: contain;
	}

	.v2-modal-head { padding: 10px 12px; }
	.v2-modal-close { width: 44px; height: 44px; }
}
