/******************************************************************************
 * Стили раздела «Планирование»
 ******************************************************************************/

.plan-page {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.plan-toolbar {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

.plan-toolbar-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-sm);
}

.plan-toolbar-leading {
	display: flex;
	align-items: center;
	gap: 6px;
}

.plan-toolbar-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-sm);
	margin-left: auto;
}

.plan-period-nav {
	display: inline-flex;
	align-items: stretch;
	min-height: 30px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	background: var(--color-surface);
	overflow: hidden;
}

.plan-period-nav-btn {
	min-width: 30px;
	height: 30px;
	padding: 0 8px;
	border: none;
	border-radius: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-size: var(--font-size-sm);
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.plan-period-nav-btn:hover {
	background: var(--color-primary-light);
	color: var(--color-primary-dark);
}

.plan-period-nav-label {
	height: 30px;
	padding: 0 12px;
	font-size: var(--font-size-xs);
	font-weight: 500;
	color: var(--color-text);
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	box-sizing: border-box;
}

.plan-period-nav-label--static {
	min-height: 30px;
	padding: 0 4px;
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
}

.plan-overlay-btn.is-active {
	border-color: var(--color-primary) !important;
	background: var(--color-primary) !important;
	color: #fff !important;
	font-weight: 600;
	box-shadow: 0 0 0 2px rgba(46, 201, 183, 0.25);
}

.plan-tabs {
	display: inline-flex;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
}

.plan-tab {
	padding: 8px 16px;
	border: none;
	background: var(--color-surface);
	color: var(--color-text-muted);
	cursor: pointer;
	font-size: var(--font-size-sm);
}

.plan-tab.is-active {
	background: var(--color-primary);
	color: #fff;
}

.plan-layout {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: var(--space-md);
	align-items: stretch;
	min-height: calc(100vh - 168px);
}

@media (max-width: 960px) {
	.plan-layout {
		grid-template-columns: 1fr;
		min-height: auto;
	}

	.plan-toolbar-top {
		flex-direction: column;
		align-items: stretch;
	}

	.plan-toolbar-leading {
		flex-wrap: wrap;
		width: 100%;
	}

	.plan-period-nav,
	.plan-period-nav-label--static {
		flex: 0 0 100%;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	.plan-period-nav {
		display: flex;
	}

	.plan-period-nav-label {
		flex: 1 1 auto;
		min-width: 0;
		white-space: normal;
		text-align: center;
		line-height: 1.25;
		padding: 4px 8px;
		height: auto;
		min-height: 30px;
	}

	.plan-period-nav-label--static {
		padding: 4px 0;
		line-height: 1.35;
		white-space: normal;
	}

	.plan-toolbar-actions {
		margin-left: 0;
		width: 100%;
	}
}

.plan-grid-wrap {
	overflow-y: auto;
	overflow-x: hidden;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	background: var(--color-surface);
	padding: var(--space-md);
	max-height: calc(100vh - 168px);
}

/* Вертикальный календарь */
.plan-calendar-vertical {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
}

.plan-month-section {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

.plan-month-section + .plan-month-section {
	margin-top: var(--space-md);
}

.plan-month-heading {
	margin: 0 calc(-1 * var(--space-md));
	padding: 11px var(--space-md);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	background: #7a77a7;
	border-bottom: none;
	letter-spacing: 0.02em;
}

.plan-calendar-vertical > .plan-month-section:first-child .plan-month-heading {
	margin-top: calc(-1 * var(--space-md));
}

.plan-week-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

.plan-week-row {
	position: relative;
	padding: 12px 14px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	background: var(--color-bg);
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}

.plan-week-row:hover {
	border-color: var(--color-primary);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.plan-week-row--drop-target {
	outline: 2px dashed var(--color-primary);
	outline-offset: -2px;
}

.plan-week-row-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-sm);
	margin-bottom: 8px;
}

.plan-week-row-title {
	font-size: var(--font-size-sm);
	font-weight: 600;
	color: var(--color-text);
}

.plan-week-row-actions {
	flex-shrink: 0;
}

.plan-week-avail-btn {
	width: 30px;
	height: 30px;
	min-width: 30px;
	min-height: 30px;
	padding: 0;
	border: 1px dashed var(--color-border);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--color-text-muted);
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.plan-week-note-icon {
	display: block;
}

.plan-week-avail-comment {
	margin: 0 0 8px;
	padding: 6px 10px;
	border-radius: var(--radius-sm);
	background: var(--color-bg-secondary);
	font-size: 12px;
	line-height: 1.4;
	color: var(--color-text-muted);
	word-break: break-word;
}

.plan-week-avail-btn:hover {
	border-color: var(--color-primary);
	color: var(--color-primary);
}

.plan-week-avail-badge {
	height: 30px;
	min-height: 30px;
	padding: 0 10px;
	border: none;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.plan-week-avail-badge--study { background: #3b82f6; }
.plan-week-avail-badge--trip { background: #f97316; }
.plan-week-avail-badge--rest { background: #22c55e; }
.plan-week-avail-badge--other { background: #64748b; }

.plan-week-tours {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.plan-week-empty {
	font-size: 12px;
	color: var(--color-text-muted);
	font-style: italic;
}

.plan-tour-chip {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 10px;
	padding-right: 52px;
	border-radius: var(--radius-sm);
	border-left: 3px solid transparent;
	background: var(--color-surface);
	cursor: pointer;
	transition: background .12s;
}

.plan-tour-chip-badge {
	position: absolute;
	top: 4px;
	right: 6px;
	max-width: 76px;
	font-size: 9px;
	font-weight: 700;
	line-height: 1.15;
	text-align: right;
	letter-spacing: 0.01em;
}

.plan-tour-chip-badge--plan {
	color: #b45309;
	text-transform: lowercase;
}

.plan-tour-chip-badge--fact {
	color: #15803d;
}

.plan-tour-chip:hover {
	background: var(--color-bg-secondary, #f1f5f9);
}

.plan-tour-chip--fact {
	border-left-color: #16a34a;
}

.plan-tour-chip--plan {
	border-left-color: #d97706;
}

.plan-tour-chip-name {
	font-size: var(--font-size-sm);
	font-weight: 600;
	line-height: 1.3;
}

.plan-tour-chip-meta {
	font-size: 11px;
	color: var(--color-text-muted);
	line-height: 1.35;
}

.plan-week-alerts-list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 8px;
}

.plan-week-alert-tag {
	font-size: 10px;
	padding: 2px 8px;
	border-radius: 999px;
	background: #fef3c7;
	color: #92400e;
}

/* Слой дисквалификации */
.plan-week-row--disqual::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: repeating-linear-gradient(
		-45deg,
		rgba(220, 38, 38, .06),
		rgba(220, 38, 38, .06) 4px,
		transparent 4px,
		transparent 8px
	);
	pointer-events: none;
}

.plan-week-row--avail-study { background: rgba(59, 130, 246, .08); }
.plan-week-row--avail-trip { background: rgba(249, 115, 22, .1); }
.plan-week-row--avail-rest { background: rgba(34, 197, 94, .1); }
.plan-week-row--avail-other { background: rgba(148, 163, 184, .12); }

.plan-week-row--alert {
	box-shadow: inset 3px 0 0 #f59e0b;
}

.plan-overlay-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: var(--font-size-sm);
}

.plan-legend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-left: var(--space-sm);
	font-size: 11px;
	color: var(--color-text-muted);
}

.plan-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.plan-legend-item::before {
	content: '';
	width: 10px;
	height: 10px;
	border-radius: 2px;
}

.plan-legend-item--fact::before { background: #16a34a; }
.plan-legend-item--plan::before { background: #d97706; }
.plan-legend-item--avail::before { background: #3b82f6; opacity: .5; }

/* Панель рекомендаций */
.plan-rec-panel {
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	background: var(--color-surface);
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 200px);
}

.plan-rec-header {
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid var(--color-border);
	font-weight: 600;
	font-size: var(--font-size-sm);
}

.plan-rec-header-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-sm);
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid var(--color-border);
}

.plan-rec-header-row .plan-rec-header {
	padding: 0;
	border-bottom: none;
}

.plan-rec-view-tabs {
	display: inline-flex;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--color-bg);
}

.plan-rec-view-tab {
	border: none;
	background: transparent;
	padding: 4px 10px;
	font-size: 11px;
	line-height: 1.3;
	color: var(--color-text-muted);
	cursor: pointer;
	white-space: nowrap;
}

.plan-rec-view-tab + .plan-rec-view-tab {
	border-left: 1px solid var(--color-border);
}

.plan-rec-view-tab.is-active {
	background: var(--color-surface);
	color: var(--color-text);
	font-weight: 600;
}

.plan-rec-view-count {
	display: inline-block;
	min-width: 1.2em;
	padding: 0 4px;
	margin-left: 2px;
	border-radius: 8px;
	background: var(--color-border);
	font-size: 10px;
	font-weight: 700;
}

.plan-rec-view-tab.is-active .plan-rec-view-count {
	background: #dbeafe;
	color: #1d4ed8;
}

.plan-rec-card--suggested {
	border-left: 3px solid #d97706;
}

.plan-rec-meta {
	margin-top: 6px;
	padding: 0 var(--space-md) var(--space-sm);
	font-size: 11px;
	color: var(--color-text-muted);
}

.plan-rec-apply-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	align-items: center;
	padding: 0 var(--space-md) var(--space-sm);
}

.plan-rec-sort-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-sm);
	padding: 0 var(--space-md) var(--space-sm);
}

.plan-rec-sort-label {
	font-size: 11px;
	color: var(--color-text-muted);
	white-space: nowrap;
}

.plan-rec-sort {
	flex: 1;
	min-width: 140px;
	max-width: 100%;
	padding: 4px 8px;
	font-size: var(--font-size-sm);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-surface);
	color: var(--color-text);
}

.plan-rec-list {
	overflow-y: auto;
	padding: var(--space-sm);
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	flex: 1;
}

.plan-rec-card {
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	padding: var(--space-sm);
	background: var(--color-bg);
	cursor: grab;
}

.plan-rec-card--fact {
	border-left: 3px solid #16a34a;
	background: #f0fdf4;
	border-color: #bbf7d0;
}

.plan-rec-card-fact-badge {
	font-size: 11px;
	font-weight: 700;
	color: #15803d;
	white-space: nowrap;
	align-self: center;
}

.plan-rec-card:active {
	cursor: grabbing;
}

.plan-rec-card-title {
	font-weight: 600;
	font-size: var(--font-size-sm);
	margin-bottom: 4px;
}

.plan-rec-card-meta {
	font-size: 11px;
	color: var(--color-text-muted);
	line-height: 1.4;
}

.plan-rec-card-score {
	font-size: 11px;
	color: var(--color-primary);
	margin-top: 4px;
}

.plan-rec-card-priority {
	font-weight: 600;
}

.plan-rec-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 6px;
}

.plan-rec-empty {
	padding: var(--space-md);
	text-align: center;
	color: var(--color-text-muted);
	font-size: var(--font-size-sm);
}

/* Модальные окна */
.plan-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 9000;
	background: rgba(0, 0, 0, .45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-md);
}

.plan-modal-overlay--help {
	z-index: 9100;
	background: transparent;
	pointer-events: none;
}

.plan-modal-overlay--help .plan-modal {
	pointer-events: auto;
	box-shadow: 0 20px 48px rgba(0, 0, 0, .28);
}

.plan-modal {
	background: var(--color-surface);
	border-radius: var(--radius-md);
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 40px rgba(0, 0, 0, .2);
}

.plan-modal-lg {
	max-width: 720px;
}

.plan-modal-xl {
	max-width: 1100px;
}

.plan-modal-footer--split {
	justify-content: space-between;
	align-items: center;
}

.plan-modal-footer.plan-modal-footer--split {
	justify-content: space-between;
}

.plan-modal-footer-actions {
	display: flex;
	gap: var(--space-sm);
}

.plan-form-hint {
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--color-text-muted);
	line-height: 1.4;
}

.plan-form-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: normal;
	cursor: pointer;
}

.plan-geo-sum {
	font-weight: 600;
	color: var(--color-primary);
}

.plan-help-body p {
	margin: 0 0 12px;
	font-size: var(--font-size-sm);
	line-height: 1.5;
}

/* Popover недоступности */
.plan-popover {
	position: fixed;
	z-index: 10100;
	width: min(280px, calc(100vw - 24px));
	padding: 14px;
	border-radius: var(--radius-md);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

.plan-popover-title {
	font-size: var(--font-size-sm);
	font-weight: 600;
	margin-bottom: 4px;
}

.plan-popover-input {
	width: 100%;
	margin: 10px 0;
	padding: 8px 10px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	font-size: var(--font-size-sm);
}

.plan-popover-actions {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	flex-wrap: wrap;
}

.plan-avail-type-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
}

.plan-avail-type-btn {
	padding: 8px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-bg);
	font-size: 12px;
	cursor: pointer;
}

.plan-avail-type-btn.is-active {
	border-color: var(--color-primary);
	background: var(--color-primary-light, #dbeafe);
	color: var(--color-primary-dark);
	font-weight: 600;
}

/* Метрики */
.plan-metrics-tour-title {
	font-size: var(--font-size-md);
	font-weight: 600;
	margin-bottom: 4px;
}

.plan-metrics-tour-meta {
	font-size: 12px;
	color: var(--color-text-muted);
	margin-bottom: var(--space-md);
}

.plan-metrics-in-zs-banner {
	width: 100%;
	box-sizing: border-box;
	margin: 0 0 var(--space-md);
	padding: 10px 14px;
	border: 1px solid #bbf7d0;
	border-left: 4px solid #16a34a;
	border-radius: var(--radius-sm);
	background: #f0fdf4;
	color: #15803d;
	font-size: var(--font-size-sm);
	font-weight: 700;
	text-align: center;
	line-height: 1.35;
}

.plan-metrics-summary {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
	margin-bottom: var(--space-md);
}

.plan-metrics-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
	margin-bottom: var(--space-md);
}

.plan-metrics-stat {
	padding: 10px 12px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-bg);
}

.plan-metrics-stat-label {
	display: block;
	font-size: 11px;
	color: var(--color-text-muted);
	margin-bottom: 4px;
}

.plan-metrics-stat-value {
	font-size: var(--font-size-md);
	font-weight: 700;
}

.plan-metrics-stat--finished-place {
	background: rgba(34, 197, 94, .1);
	border-color: rgba(34, 197, 94, .25);
}

.plan-metrics-stat--finished-place .plan-metrics-stat-value {
	color: #15803d;
}

.plan-metrics-stat-hint {
	display: block;
	margin-top: 4px;
	font-size: 10px;
	line-height: 1.35;
	color: var(--color-text-muted);
	font-weight: normal;
}

.plan-metrics-subtitle {
	margin: 0 0 8px;
	font-size: var(--font-size-sm);
}

.plan-metrics-history {
	margin-top: var(--space-lg);
	padding-top: var(--space-md);
	border-top: 1px solid var(--color-border);
}

.plan-metrics-expected {
	margin: 0 0 var(--space-md);
	text-align: center;
}

.plan-metrics-expected-label {
	font-weight: 700;
	font-size: var(--font-size-md);
	line-height: 1.35;
	margin-bottom: 6px;
}

.plan-metrics-expected-value {
	font-weight: 700;
	font-size: 1.75rem;
	line-height: 1.2;
}

.plan-metrics-table-wrap {
	overflow-x: auto;
}

.plan-metrics-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
	table-layout: fixed;
}

.plan-metrics-table th,
.plan-metrics-table td {
	padding: 8px 10px;
	border: 1px solid var(--color-border);
	text-align: left;
	vertical-align: top;
}

.plan-metrics-table th {
	background: var(--color-bg);
	font-weight: 600;
	line-height: 1.3;
}

.plan-metrics-th-place {
	width: 16%;
}

.plan-metrics-th-count {
	width: 11%;
}

.plan-metrics-th-num {
	width: 15%;
	text-align: right;
}

.plan-metrics-table td:nth-child(n+2) {
	text-align: right;
	white-space: nowrap;
}

.plan-metrics-th-note {
	display: block;
	margin-top: 2px;
	font-size: 10px;
	font-weight: normal;
	color: var(--color-text-muted);
}

.plan-metrics-spread-pct {
	color: var(--color-text-muted);
	font-weight: normal;
	font-size: 11px;
}

.plan-metrics-spread-level {
	display: block;
	margin-top: 2px;
	font-size: 10px;
	font-weight: normal;
	color: var(--color-text-muted);
	line-height: 1.3;
}

.plan-metrics-td-spread {
	white-space: normal !important;
}

.plan-metrics-spread-legend {
	margin: 0 0 8px;
	font-size: 11px;
	line-height: 1.45;
	color: var(--color-text-muted);
}

.plan-metrics-th-short {
	display: none;
}

@media (max-width: 759px) {
	.plan-metrics-th-full {
		display: none;
	}

	.plan-metrics-th-short {
		display: inline;
	}

	.plan-metrics-th-num {
		width: auto;
		padding-left: 6px;
		padding-right: 6px;
		font-size: 11px;
	}
}

.plan-request-detail {
	margin: 8px 0 16px;
	font-size: var(--font-size-sm);
	line-height: 1.5;
}

.plan-request-detail-line {
	margin: 0 0 6px;
}

.plan-request-stats {
	margin-bottom: 8px;
}

.plan-tour-detail-card {
	padding: 12px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	margin-bottom: 10px;
}

.plan-tour-detail-card:last-child {
	margin-bottom: 0;
}

.plan-tour-detail-title {
	font-weight: 600;
	margin-bottom: 4px;
}

.plan-tour-detail-meta {
	font-size: 12px;
	color: var(--color-text-muted);
	margin-bottom: 8px;
}

.plan-tour-detail-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.plan-modal-md {
	max-width: 480px;
}

.plan-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-md);
	border-bottom: 1px solid var(--color-border);
}

.plan-modal-header h3 {
	margin: 0;
	font-size: var(--font-size-md);
}

.plan-modal-close {
	border: none;
	background: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: var(--color-text-muted);
}

.plan-modal-body {
	padding: var(--space-md);
	overflow-y: auto;
}

.plan-modal-footer {
	padding: var(--space-md);
	border-top: 1px solid var(--color-border);
	display: flex;
	justify-content: flex-end;
	gap: var(--space-sm);
}

.plan-form-row {
	margin-bottom: var(--space-sm);
}

.plan-form-row label {
	display: block;
	font-size: var(--font-size-sm);
	margin-bottom: 4px;
}

.plan-form-row input[type="text"],
.plan-form-row input[type="date"],
.plan-form-row input[type="number"],
.plan-form-row select,
.plan-form-row textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	font-size: var(--font-size-sm);
	background: var(--color-bg);
}

.plan-form-row-inline {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-sm);
}

.plan-geo-sliders {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.plan-geo-slider-row {
	display: grid;
	grid-template-columns: 100px 1fr 40px;
	gap: 8px;
	align-items: center;
	font-size: var(--font-size-sm);
}

.plan-advanced-toggle {
	border: none;
	background: none;
	color: var(--color-primary);
	cursor: pointer;
	font-size: var(--font-size-sm);
	padding: 0;
	margin-bottom: var(--space-sm);
}

.plan-advanced {
	display: none;
}

.plan-advanced.is-open {
	display: block;
}

.plan-week-tour {
	position: relative;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	padding: var(--space-sm);
	padding-top: 28px;
	margin-bottom: var(--space-sm);
}

.plan-week-tour-source {
	position: absolute;
	top: 8px;
	right: 10px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
}

.plan-week-tour-source--plan {
	color: #c2410c;
}

.plan-week-tour-source--fact {
	color: #15803d;
}

.plan-home-hint {
	margin: 0;
	font-size: var(--font-size-md);
	color: var(--color-text);
}

.plan-help-body h4 {
	margin: 16px 0 8px;
	font-size: var(--font-size-sm);
}

.plan-help-body h4:first-child {
	margin-top: 0;
}

.plan-modal-sm {
	max-width: 360px;
}

.plan-week-tour-title {
	font-weight: 600;
	font-size: var(--font-size-sm);
}

.plan-week-tour-meta {
	font-size: 11px;
	color: var(--color-text-muted);
	margin-top: 2px;
}

.plan-week-tour-actions {
	margin-top: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.plan-linked-block {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px dashed var(--color-border);
	font-size: 11px;
}

.plan-avail-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

.plan-avail-item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-sm);
	padding: var(--space-sm);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
}

.plan-avail-item--study { border-left: 4px solid #3b82f6; }
.plan-avail-item--trip { border-left: 4px solid #f97316; }
.plan-avail-item--rest { border-left: 4px solid #22c55e; }
.plan-avail-item--other { border-left: 4px solid #94a3b8; }

.plan-points-table-wrap {
	overflow-x: auto;
	margin-top: 12px;
}

.plan-points-modal-tour-name {
	font-size: var(--font-size-md);
	font-weight: 600;
	line-height: 1.35;
	margin-bottom: 4px;
}

.plan-points-modal-tour-meta {
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
	line-height: 1.4;
	margin-bottom: 0;
}

.plan-points-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--font-size-sm);
}

.plan-points-table th,
.plan-points-table td {
	border: 1px solid var(--color-border);
	padding: 8px 10px;
	text-align: left;
}

.plan-points-table th {
	background: var(--color-bg);
}

/* Карта */
.rmap-canvas {
	min-height: 200px;
	border: 1px dashed var(--color-border);
	border-radius: var(--radius-sm);
	padding: var(--space-md);
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	margin-bottom: var(--space-md);
	background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.rmap-pin {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	font-size: 12px;
}

.rmap-pin-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--color-primary);
	flex-shrink: 0;
}

.rmap-timeline {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.rmap-week-btn {
	border: 1px solid var(--color-border);
	background: var(--color-bg);
	border-radius: var(--radius-sm);
	padding: 4px 10px;
	font-size: 12px;
	cursor: pointer;
}

.rmap-week-btn.is-active {
	background: var(--color-primary);
	color: #fff;
	border-color: var(--color-primary);
}

.rmap-empty {
	color: var(--color-text-muted);
	font-size: var(--font-size-sm);
}
