.canvas-wrapper {
    display: inline-block;
    transform-origin: top left;
}

.manual-preview-color {
    text-align: center;
    color: #fff;
    min-height: 600px;
    padding: 40px 0;
}

.manual-font {
    word-wrap: anywhere;
}

.manual-image-wrapper {
    text-align: center;
    position: relative;
}

.manual-image-wrapper img {
    max-height: 200px;
    max-width: 100%;
    width: 100%;
}

.manual-image-wrapper.manual-image-square img {
    max-height: 200px;
}

.manual-image-wrapper.manual-image-horizontal img {
    max-height: 120px;
}

.manual-image-wrapper.manual-image-square-smaller img {
    max-height: 200px;
}

.manual-image-wrapper.manual-image-square-symbol {
    height: 416px;
}

.manual-image-wrapper.manual-image-square-symbol img {
    max-height: 200px;
}

.manual-image-wrapper.manual-image-vertical-big img {
    max-height: 120px;
}

.manual-kozelsky-koupelny-logomanual .manual-image-vertical-big.protected-zone-wrapper img {
    width: 400px !important;
}

.manual-kozelsky-koupelny-logomanual .manual-image-symbol.protected-zone-wrapper img {
    width: 110px !important;
}

.manual-kozelsky-koupelny-logomanual .manual-image-vertical.protected-zone-wrapper img {
    width: 400px !important;
}

.manual-page {
    margin-bottom: 50px;
}

.protected-zone-wrapper img {
    width: 100% !important;
    max-height: unset !important;
}

.protected-zone-top,
.protected-zone-bottom,
.protected-zone-left,
.protected-zone-right {
    position: absolute;
    display: block;
    color: #ffffff;
    font-size: 12px;
}

.protected-zone-top {
    border-left: 1px solid #ffffff;
    left: 30%;
    top: 0;
    height: 72px;
    line-height: 72px;
    padding-left: 10px;
}

.protected-zone-bottom {
    border-left: 1px solid #ffffff;
    left: 30%;
    bottom: 0;
    height: 72px;
    line-height: 72px;
    padding-left: 10px;
}

.protected-zone-left {
    border-bottom: 1px solid #ffffff;
    left: 0;
    top: 40%;
    width: 72px;
    text-align: center;
}

.protected-zone-right {
    border-bottom: 1px solid #ffffff;
    right: 0;
    top: 40%;
    width: 72px;
    text-align: center;
}

.text-lighter {
    color: #bbb !important;
}

.dragula-handle-absolute-left {
    text-align: left !important;
    left: -6px !important;
    width: 30px !important;
    color: #bbb !important;
}

.with-width-info {
    padding-top: 35px;
}

.logo-width-info {
    position: absolute;
    top: -38px;
    left: 0;
    text-align: center;
    border-bottom: 2px solid #ccc;
    width: 100%;
    font-weight: bold;
}

.logo-width-info::before {
    content: "";
    width: 2px;
    height: 10px;
    position: absolute;
    background: #ccc;
    left: -2px;
    bottom: -6px;
}

.logo-width-info::after {
    content: "";
    width: 2px;
    height: 10px;
    position: absolute;
    background: #ccc;
    right: -2px;
    bottom: -6px;
}


.with-height-info {
    padding-left: 100px;
}

.logo-height-info {
    position: absolute;
    left: -100px;
    text-align: center;
    border-right: 2px solid #ccc;
    width: 85px;
    height: 100%;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}


.logo-height-info::before {
    content: "";
    height: 2px;
    width: 10px;
    position: absolute;
    background: #ccc;
    top: -2px;
    right: -6px;
}

.logo-height-info::after {
    content: "";
    height: 2px;
    width: 10px;
    position: absolute;
    background: #ccc;
    bottom: -2px;
    right: -6px;
}

/* Weekly Menu Planner Styles */
.btn-delete-day {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    transition: all 0.15s ease;
}

.btn-delete-day:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.meal-card {
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fff;
    border: 1px solid #dee2e6;
}

.meal-card:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-color: #6c757d;
    transform: translateY(-1px);
}

.meal-chip {
    transition: all 0.15s ease;
}

.meal-chip:hover {
    filter: brightness(0.95);
}

.meal-chip .btn-close {
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.meal-chip:hover .btn-close {
    opacity: 0.8;
}

.meal-type-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Dragula drag and drop styles */
.gu-mirror {
    position: fixed !important;
    margin: 0 !important;
    z-index: 9999 !important;
    opacity: 0.8;
    pointer-events: none;
}

.gu-hide {
    display: none !important;
}

.gu-unselectable {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

.gu-transit {
    opacity: 0.4;
}

/* Compact Meal Selector Modal */
.meal-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

.meal-selector-item {
    display: inline-flex;
    flex-direction: column;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s ease;
    min-width: 120px;
    max-width: 200px;
    flex: 0 1 auto;
}

.meal-selector-item:hover {
    background: #f0f4ff;
    border-color: #727cf5;
    box-shadow: 0 1px 4px rgba(114, 124, 245, 0.25);
}

.meal-selector-item.d-none {
    display: none !important;
}

.meal-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.meal-selector-name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.meal-selector-type {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 1px 3px;
    border-radius: 2px;
    flex-shrink: 0;
    line-height: 1;
}

.meal-selector-meta {
    font-size: 12px;
    color: #666;
    line-height: 1.2;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meal-selector-diet {
    font-weight: 500;
    color: #555;
}

.meal-selector-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 5px;
    padding-top: 6px;
    border-top: 1px solid #eee;
}

.meal-selector-variant {
    font-size: 11px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 0 3px;
    border-radius: 2px;
    color: #555;
    line-height: 1.3;
}

/* Reference Meal Selector (in form) */
.reference-meal-grid-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px;
    background: #fafafa;
}

.reference-meal-preview {
    min-height: 50px;
}

.reference-meal-selected .meal-selector-item {
    cursor: default;
    background: #e8f4fd;
    border-color: #727cf5;
}

.reference-meal-selected .meal-selector-item:hover {
    background: #e8f4fd;
    box-shadow: none;
}

.reference-meal-empty {
    font-size: 0.875rem;
    text-align: center;
}

/* Selected state for meal cards */
.meal-selector-item.selected {
    background: #e8f4fd;
    border-color: #727cf5;
    box-shadow: 0 0 0 2px rgba(114, 124, 245, 0.3);
}

.meal-selector-item.selected::before {
    content: '\2713';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.65rem;
    color: #727cf5;
    font-weight: bold;
}

.meal-selector-item {
    position: relative;
}

/* Planner meal cards (in day planner, reusing modal styles) */
.planner-meal-card {
    cursor: default;
}

.planner-meal-card.draggable {
    cursor: grab;
}

.planner-meal-card.draggable:active {
    cursor: grabbing;
}

.planner-meal-card .meal-selector-header {
    gap: 6px;
}

.planner-meal-card .btn-close {
    opacity: 0.4;
    transition: opacity 0.15s ease;
    margin-left: auto;
}

.planner-meal-card:hover .btn-close {
    opacity: 0.8;
}

/* Nutritional values display styles */
/* Nutrition summary base styles */
.nutrition-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nutrition-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.nutrition-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

.nutrition-badge-item {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1.2;
    white-space: nowrap;
    background-color: #fff !important;
    border: 1px solid currentColor;
}

.nutrition-badge-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

/* Weekly summary - stats grid design */
.nutrition-stats-weekly {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.06) 0%, rgba(var(--bs-primary-rgb), 0.02) 100%);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.15);
    border-radius: 8px;
    padding: 12px 16px;
}

.nutrition-stats-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bs-primary);
    margin-bottom: 10px;
}

.nutrition-stats-header i {
    font-size: 1rem;
}

.nutrition-incomplete-badge {
    background: #ffc107;
    color: #212529;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.nutrition-stats-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nutrition-stat-item {
    background: #fff;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.12);
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 80px;
    text-align: center;
}

.nutrition-stat-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--bs-primary);
    line-height: 1.2;
}

.nutrition-stat-label {
    display: block;
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}


/* Variant summary */
.nutrition-summary-variant {
    margin-top: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px dashed #ddd;
}

.nutrition-summary-variant .nutrition-label {
    font-size: 0.7rem;
}

.nutrition-summary-variant .nutrition-badge-item {
    font-size: 9px;
    padding: 1px 4px;
}

/* Legacy support - remove if not used elsewhere */
.nutrition-badge {
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    color: #555;
}

.meal-selector-nutrition {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 5px;
    padding-top: 6px;
    border-top: 1px dashed #eee;
}

/* Menu display nutrition styles */
.menu-nutrition-summary {
    font-size: 0.9rem;
    color: #666;
    margin-top: 8px;
}

.meal-nutrition {
    font-size: 0.8em;
    color: #888;
    font-weight: normal;
    margin-left: 4px;
}

/* Collapsible sections using native <details> element */
.collapsible-section {
    /* Remove default marker */
}

.collapsible-section > summary {
    list-style: none;
}

.collapsible-section > summary::-webkit-details-marker {
    display: none;
}

.collapsible-section > summary::marker {
    display: none;
}

/* Chevron icon animation */
.collapsible-icon {
    transition: transform 0.2s ease;
    font-size: 1.1em;
}

.collapsible-section[open] > summary .collapsible-icon {
    transform: rotate(90deg);
}

/* Chevron stays rotated during closing animation */
.collapsible-section.closing > summary .collapsible-icon {
    transform: rotate(0deg);
}

/* Smooth height animation using grid */
.collapsible-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease-out;
}

.collapsible-section[open] > .collapsible-content {
    grid-template-rows: 1fr;
}

/* When closing, keep content visible during animation */
.collapsible-section.closing > .collapsible-content {
    grid-template-rows: 0fr;
}

.collapsible-content > .collapsible-inner {
    min-height: 0;
}

/* Only apply overflow hidden during animations (open/close) */
.collapsible-section.animating > .collapsible-content > .collapsible-inner {
    overflow: hidden;
}

/* Day level styles */
.collapsible-day > summary {
    user-select: none;
}

.collapsible-day > summary:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.12) !important;
}

/* Meal type level styles */
.collapsible-meal-type > summary {
    position: relative;
}

.collapsible-meal-type > summary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    border-radius: inherit;
    transition: background 0.15s;
}

.collapsible-meal-type > summary:hover::before {
    background: rgba(0, 0, 0, 0.03);
}

/* Course level styles */
.collapsible-course > summary:hover {
    background-color: color-mix(in srgb, var(--course-color) 20%, white) !important;
}

.collapsible-course > summary {
    border-bottom-left-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

.collapsible-course[open] > summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Fix dropdown overlap issues in planner */
.collapsible-day .dropdown {
    display: inline-block !important;
}
