* {
    box-sizing: border-box;
    font-family: 'Kode Mono', monospace,system-ui, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #fff7f0, #f1e8df);
    padding: 20px;
    transition: background 0.3s;
    display: flex;           /* Add this */
    justify-content: center; /* Add this */
    align-items: center;     /* Add this */
}

body.dark-theme {
    background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
    color: white;
}

body.menu-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.48);
    pointer-events: none;
}

/* Burger Menu */
.burger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.burger-icon {
    font-size: 24px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.512);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body.dark-theme .burger-icon {
    background: rgba(50, 50, 50, 0.524);
}

.menu-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 120px;
    overflow: hidden;
}

.menu-dropdown::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, background 0.18s ease;
}

body.submenu-open .menu-dropdown::after {
    background: rgba(0, 0, 0, 0.44);
    opacity: 1;
}

body.dark-theme .menu-dropdown {
    background: #333;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

body.dark-theme .menu-item {
    border-bottom: 1px solid #444;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #f5f5f5;
}

body.dark-theme .menu-item:hover {
    background: #444;
}

#menuHome {
    position: relative;
    padding-left: 40px; /* Add space for the icon */
    cursor: pointer;
}

#menuHome::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

body.dark-theme #menuHome::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ccc"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
}

#menuHome:hover {
    background: #f5f5f5;
}

body.dark-theme #menuHome:hover {
    background: #444;
}

/* SUBMENU STYLES */
.submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 150px;
    z-index: 1001;
}

body.dark-theme .submenu {
    background: #333;
}

.submenu-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

body.dark-theme .submenu-item {
    border-bottom: 1px solid #444;
}

.submenu-item:last-child {
    border-bottom: none;
}

.submenu-item:hover {
    background: #f5f5f5;
}

body.dark-theme .submenu-item:hover {
    background: #444;
}

/* Back to Top Button - CONTEXTUAL VERSION */
.back-to-top-btn {
    /* Positioning */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    
    /* Display & Visibility - HIDDEN BY DEFAULT */
    display: none; /* Changed from flex to none */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    
    /* Wavy Shape Logic */
    --s: 2px;  /* control the size of the wave */
    --w: 32px; /* preferred  width */
    
    width: round(var(--w),4*var(--s)); 
    aspect-ratio: 1;
    padding: var(--s);
    border: var(--s) solid #0000;
    box-sizing: border-box;
    background: #8bc34a;
    border-radius: calc(3.5*var(--s)); /* for the image */
    mask: 
        radial-gradient(calc(sqrt(2)*var(--s)),#000 calc(100% - 1px),#0000),
        conic-gradient(#000 0 0) content-box,
        radial-gradient(calc(sqrt(2)*var(--s)),#0000 100%,#000 calc(100% + 1px)) 
        var(--s) var(--s) padding-box;
    mask-size: calc(var(--s)*4) calc(var(--s)*4);
}

/* Show only when inside community or content sections
#contentView:not(.hidden) #backToTopBtn {
    display: flex;
}
#communityView:not(.hidden) #backToTopBtn {
    display: flex;
} */

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn:hover {
    transform: translateY(-5px);
    background: #5a7c5a; /* Changes color on hover */
}

.back-to-top-btn:active {
    transform: translateY(0);
}

/* Dark theme */
body.dark-theme .back-to-top-btn {
    background: rgba(139, 195, 74, 0.15);
    border-color: rgba(104, 141, 62, 0.3);
    color: #8bc34a;
    backdrop-filter: blur(10px) brightness(0.8);
}

body.dark-theme .back-to-top-btn:hover {
    background: rgba(139, 195, 74, 0.25);
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Hide button on small screens when keyboard might be open */
@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 80px; /* Higher up to avoid mobile browser UI */
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

/* Animation for appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.back-to-top-btn.visible {
    animation: fadeInUp 0.3s ease-out;
}

/* BACKUP MODAL STYLES */
#backupRestoreModal .modal-content {
    max-width: 400px;
}

.backup-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.backup-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #2196F3;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.backup-btn.danger {
    background: #f44336;
}

.backup-btn:hover {
    opacity: 0.9;
}

.backup-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

body.dark-theme .backup-info {
    background: #333;
}

.backup-info ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

/* Views */
.view {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

.app-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.app-title {
    text-align: center;
    margin-bottom: 10px;
}

body.dark-theme .app-container {
    background: rgba(50, 50, 50, 0.7);
}

/* Calendar view widens the regular app shell so a full month remains scannable. */
#calendarView {
    max-width: 960px;
}

.calendar-app-container {
    padding: 16px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.calendar-header h2 {
    margin-bottom: 4px;
}

.calendar-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

body.dark-theme .calendar-subtitle {
    color: #aaa;
}

.calendar-toggle {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    color: #444;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.calendar-toggle input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #4CAF50;
    cursor: pointer;
}

body.dark-theme .calendar-toggle {
    color: #ddd;
}

.calendar-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.calendar-controls button {
    min-width: 42px;
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 8px;
    background: #5f6f52;
}

.calendar-month-label {
    margin: 8px 0 12px;
    text-align: center;
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

body.dark-theme .calendar-month-label {
    color: #f2f2f2;
}

.calendar-selected-ferment {
    position: fixed;
    z-index: 2200;
    max-width: min(360px, calc(100vw - 24px));
    margin: 0;
    padding: 12px 32px 12px 12px;
    border-left: 4px solid #4CAF50;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    color: #1f1f1f;
    font-weight: bold;
    pointer-events: auto;
}

.calendar-popover-close {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 22px;
    height: 22px;
    min-width: 22px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #d32f2f;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.calendar-popover-close:hover,
.calendar-popover-close:focus {
    background: #2e7d32;
    outline: none;
}

body.dark-theme .calendar-selected-ferment {
    background: #242424;
    color: #f6f6f6;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

body.dark-theme .calendar-popover-close {
    border-color: #242424;
}

.calendar-day-popover-empty {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 12px;
    font-weight: normal;
}

body.dark-theme .calendar-day-popover-empty {
    color: #ccc;
}

.calendar-day-popover-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: min(420px, calc(100vh - 120px));
    margin: 8px 0 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.calendar-day-popover-ferment {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.calendar-day-popover-ferment:hover,
.calendar-day-popover-ferment:focus {
    background: rgba(76, 175, 80, 0.12);
    outline: none;
}

body.dark-theme .calendar-day-popover-ferment:hover,
body.dark-theme .calendar-day-popover-ferment:focus {
    background: rgba(76, 175, 80, 0.22);
}

.calendar-day-popover-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.calendar-day-popover-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.calendar-day-popover-name-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.calendar-day-popover-name.is-overflowing .calendar-day-popover-name-text {
    max-width: none;
    padding-left: 100%;
    overflow: visible;
    text-overflow: clip;
    animation: calendar-name-marquee var(--calendar-name-marquee-duration, 9s) linear infinite;
}

@keyframes calendar-name-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.calendar-day-popover-status {
    color: #666;
    font-size: 11px;
    font-weight: normal;
    white-space: nowrap;
}

body.dark-theme .calendar-day-popover-status {
    color: #ccc;
}

/* Calendar grid uses fixed columns and stacked block rows to prevent ferment overlap. */
.calendar-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
}

.calendar-weekday {
    padding: 0 4px 6px;
    color: #666;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

body.dark-theme .calendar-weekday {
    color: #aaa;
}

.calendar-day {
    --calendar-block-area-height: 86px;
    min-height: 116px;
    padding: 6px 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.64);
    overflow: visible;
    margin: -1px 0 0 -1px;
}

body.dark-theme .calendar-day {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.calendar-day-empty {
    background: transparent;
    border-color: transparent;
}

.calendar-today {
    border-color: #4CAF50;
    box-shadow: inset 0 0 0 5px #4CAF50;
}

.calendar-day-number {
    margin-bottom: 5px;
    padding: 0 6px;
    color: #333;
    font-size: 12px;
    font-weight: bold;
}

body.dark-theme .calendar-day-number {
    color: #f2f2f2;
}

.calendar-day-without-ferments .calendar-day-number {
    color: #777;
}

.calendar-day-blocks {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: var(--calendar-block-area-height);
    overflow: visible;
}

.calendar-ferment-block {
    position: relative;
    width: calc(100% + 1px);
    height: min(22px, calc(var(--calendar-block-area-height) / var(--calendar-lane-count)));
    min-height: 0;
    flex: 0 0 min(22px, calc(var(--calendar-block-area-height) / var(--calendar-lane-count)));
    padding: 3px 6px;
    border: 0;
    border-radius: 0;
    background: var(--ferment-color);
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.25;
    text-align: left;
    overflow: visible;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 1;
}

.calendar-ferment-block::before,
.calendar-ferment-block::after {
    content: '';
    position: absolute;
    top: 0;
    width: 9px;
    height: 100%;
    background: var(--ferment-color);
    pointer-events: none;
    z-index: 0;
}

.calendar-ferment-block::before {
    left: -8px;
    clip-path: polygon(100% 0, 100% 100%, 0 50%);
}

.calendar-ferment-block::after {
    right: -8px;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.calendar-ferment-continues-left::before,
.calendar-ferment-continues-right::after {
    display: none;
}

.calendar-ferment-label {
    position: absolute;
    top: 50%;
    left: calc((var(--calendar-label-days-before) * -100%) - (var(--calendar-label-days-before) * 1px));
    width: calc((var(--calendar-label-span-days) * 100%) + ((var(--calendar-label-span-days) - 1) * 1px));
    padding: 0 8px;
    transform: translateY(-50%);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

.calendar-compact-lanes .calendar-ferment-block {
    padding: 0;
    color: transparent;
    font-size: 0;
}

.calendar-compact-lanes .calendar-ferment-label {
    display: none;
}

.calendar-ferment-block-unlabeled {
    color: transparent;
    font-size: 0;
}

.calendar-ferment-block-labeled {
    z-index: 5;
}

/* Arrow caps make the first and last visible segment read as a sharp start/end. */
/* Continuation classes remove rounded ends so adjacent days read as one ferment bar. */
.calendar-ferment-continues-left {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.calendar-ferment-continues-right {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.calendar-ferment-spacer {
    height: min(22px, calc(var(--calendar-block-area-height) / var(--calendar-lane-count)));
    min-height: 0;
    flex: 0 0 min(22px, calc(var(--calendar-block-area-height) / var(--calendar-lane-count)));
}

.calendar-ferment-block:hover,
.calendar-ferment-block:focus {
    opacity: 0.9;
    outline: 2px solid rgba(0, 0, 0, 0.22);
    outline-offset: 1px;
}

body.dark-theme .calendar-ferment-block:focus {
    outline-color: rgba(255, 255, 255, 0.45);
}

.calendar-empty-state {
    grid-column: 1 / -1;
    padding: 20px;
    color: #666;
    text-align: center;
}

body.dark-theme .calendar-empty-state {
    color: #aaa;
}

#backFromCalendarBtn {
    margin-top: 16px;
}

@media (max-width: 720px) {
    .calendar-header {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-controls {
        justify-content: space-between;
    }

    .calendar-day {
        --calendar-block-area-height: 64px;
        min-height: 92px;
        padding: 4px 0;
    }

    .calendar-ferment-block {
        height: min(18px, calc(var(--calendar-block-area-height) / var(--calendar-lane-count)));
        flex-basis: min(18px, calc(var(--calendar-block-area-height) / var(--calendar-lane-count)));
        padding: 2px 4px;
        font-size: 9px;
    }

    .calendar-ferment-spacer {
        height: min(18px, calc(var(--calendar-block-area-height) / var(--calendar-lane-count)));
        flex-basis: min(18px, calc(var(--calendar-block-area-height) / var(--calendar-lane-count)));
    }
}

/* CAROUSEL STYLES */

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
    overflow: visible;
}

.ferments-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    touch-action: pan-y;
    padding: 14px 10px 28px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-item {
    position: relative;
    flex: 0 0 calc(100% - 20px);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 15px;
    padding: 22px 20px 34px;
    scroll-snap-align: center; /* Center item when snapping */
    scroll-snap-stop: always;
    border: 1px solid #ddd;
    margin: 0 10px;
    text-align: center;
}

.carousel-timer {
    font-size: clamp(22px, 9vw, 36px);
    font-weight: bold;
    margin: 15px 0;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    line-height: 1.1;
    max-width: 100%;
}

.carousel-timer.long-time {
    font-size: clamp(17px, 6.2vw, 25px);
}

.carousel-start-time{
  font-size: 11px;
  color: #888;
  margin: 5px 0;
}
.carousel-end-time{
  font-size: 11px;
  color: #888;
  margin: 5px 0;
}

.carousel-status {
    font-size: 16px;
    font-weight: bold;
    color: #666;
}

body.dark-theme .carousel-item {
    background: rgba(50, 50, 50, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ferments-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Carousel stage styling */
.carousel-stage {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
}

body.dark-theme .carousel-stage {
    color: #aaa;
}

/* Days display */
.carousel-days {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 5px 0;
    font-weight: bold;
}

body.dark-theme .carousel-days {
    color: #aaa;
}

/* Progress bar */
.carousel-progress {
    height: 3px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    margin: 10px 5px 5px 5px;
    overflow: hidden;
}

body.dark-theme .carousel-progress {
    background-color: rgba(255, 255, 255, 0.1);
}

.carousel-progress-bar {
    height: 100%;
    width: 0%;
    background-color: #4CAF50;
    border-radius: 2px;
    transition: width 1s ease, background-color 1s ease;
}

/* UPDATED CAROUSEL BUTTONS - THINNER AND TALLER */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 24px;  /* Thinner */
    height: 60px; /* Taller */
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.dark-theme .carousel-btn {
    background: rgba(50, 50, 50, 0.8);
    color: white;
}

.carousel-container:hover .carousel-btn {
    opacity: 1;
}

#prevBtn {
    left: -20px;
    height: 120px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#nextBtn {
    right: -20px;
    height: 120px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}

body.dark-theme .carousel-btn:hover {
    background: rgba(70, 70, 70, 0.95);
}

/* Show buttons when there are items */
.carousel-btn.visible {
    opacity: 0.7;
}

.carousel-btn.visible:hover {
    opacity: 1;
}

.carousel-btn:disabled {
    cursor: default;
    opacity: 0.2;
    pointer-events: none;
}

.carousel-counter {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    min-width: 48px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: #666;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.2;
}

body.dark-theme .carousel-counter {
    background: rgba(255, 255, 255, 0.1);
    color: #bbb;
}

/* Timer Display */
#activeTimerDisplay {
    display: none;
}

#timerDisplay {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
    font-family: monospace;
}

/* Form */
.add-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input, textarea {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 16px;
}

body.dark-theme input,
body.dark-theme textarea {
    background: #444;
    color: white;
    border: 1px solid #555;
}

/* Input row for side-by-side inputs */
.input-row {
    display: flex;
    flex-direction: column;

    gap: 10px;
    width: 100%;
}

#hoursAndStage {
    flex: auto;
    flex-direction: column;
}

.duration-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(42px, 1fr));
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.duration-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    color: #666;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
}

.duration-field input {
    width: 100%;
    min-width: 0;
    padding: 10px 4px;
    border-radius: 10px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
}

.duration-field input::placeholder {
    color: #aaa;
}

/* Stage selector styling */
.stage-select {
    width: 100%;
    max-width: 260px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 16px;
    background: white;
    color: #333;
    align-self: center;
}

body.dark-theme .duration-field {
    color: #aaa;
}

body.dark-theme .duration-field input {
    background: #444;
    color: white;
    border: 1px solid #555;
}

body.dark-theme .stage-select {
    background: #444;
    color: white;
    border: 1px solid #555;
}

/* Update existing input styles to be more compact */
/* input[type="number"] { */
    /* Keep existing styles but allow flexible width */
/* } */

.controls-row {
    display: flex;
    flex-direction: row; /* Force side-by-side */
    align-items: center; /* Vertically center them */
    gap: 8px;            /* Space between input and button */
}

.date-control-row {
    align-items: center;
}

#targetDateInput,
#startedAtInput {
    flex: 1;
    min-width: 0;
    max-width: 230px;
    height: 40px;
    box-sizing: border-box;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    margin-bottom: 3px;
    display: block;
}

/* Reset button styling */
.reset-btn {
    width: 40px;
    height: 40px;       /* Match the height of the input */
    min-width: 40px;
    max-width: 40px;
    flex: 0 0 40px;
    padding: 0;          /* Reset padding to center the icon */
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: #666;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.date-control-row .reset-btn {
    align-self: center;
    height: 40px;
    line-height: 1;
}

.reset-btn:hover {
    background: #555;
}

body.dark-theme .reset-btn {
    background: #555;
}

body.dark-theme .reset-btn:hover {
    background: #666;
}

/* Mobile: Stacked */
@media (max-width: 480px) {
    .duration-inputs {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stage-select {
        max-width: 100%;
    }

    .controls-row {
        flex-direction: column; /* Stacks the input and button */
        align-items: stretch;   /* Makes them the same width */
    }

    .date-control-row {
        flex-direction: row;
    }

    #targetDateInput,
    #startedAtInput {
        max-width: 100%;      /* Let the input use full width for visibility */
    }

    .reset-btn {
        width: 100%;          /* Make button easy to tap on mobile */
        height: 45px;         /* Slightly larger touch target */
    }

    .date-control-row .reset-btn {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        flex-basis: 44px;
        height: 40px;
    }
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

button {
    padding: 12px 5px;
    border: none;
    border-radius: 10px;
    background: #88887b;
    color: white;
    font-size: 1em;
    cursor: pointer;
    flex: 1;
}

button:hover {
    opacity: 0.9;
}

#backToMainBtn {
    background: #666;
    margin-top: 20px;
}

/* Ferments List */
.ferment-search {
    margin-bottom: 14px;
}

.ferment-search input {
    width: 100%;
}

.ferment-search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 300px;
}

.ferment-search-result {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 15px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    cursor: pointer;
}

.ferment-search-result:hover,
.ferment-search-result:focus {
    outline: none;
    background: rgba(255,255,255,0.9);
}

.history-search-result {
    color: #777;
    background: rgba(240,240,240,0.55);
}

.ferment-search-main,
.ferment-search-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ferment-search-main span,
.ferment-search-meta {
    color: #666;
    font-size: 13px;
}

.ferment-search-empty {
    color: #666;
    text-align: center;
}

body.dark-theme .ferment-search-result {
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(255,255,255,0.08);
}

body.dark-theme .ferment-search-result:hover,
body.dark-theme .ferment-search-result:focus {
    background: rgba(120, 120, 120, 0.38);
}

body.dark-theme .history-search-result,
body.dark-theme .ferment-search-main span,
body.dark-theme .ferment-search-meta,
body.dark-theme .ferment-search-empty {
    color: #aaa;
}

.ferment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255,255,255,0.6);
    border-radius: 10px;
    margin-bottom: 10px;
}

body.dark-theme .ferment-item {
    background: rgba(100, 100, 100, 0.3);
}

.ferment-info {
    display: flex;
    flex-direction: column;
}

.view-btn {
    max-width: 75px;
    padding: 8px 16px;
    font-size: 12px;
    background: #515151;
}

/* Modals */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overscroll-behavior: contain;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

body.modal-open {
    /* Locks background content so scroll momentum cannot pass through an active modal. */
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

#itemModal .modal-content {
    max-width: 760px;
}

.notes-editor {
    margin-top: 15px;
}

.notes-editor label {
    display: block;
    margin-bottom: 6px;
    color: #666;
    font-size: 13px;
    font-weight: bold;
}

#modalNotes {
    width: 100%;
    min-height: 260px;
    margin-top: 0;
    white-space: pre-wrap;
    color: #adadad;
    line-height: 1.5;
    resize: vertical;
}

.notes-preview-toggle {
    width: auto;
    max-width: 180px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 8px;
    background: #666;
    font-size: 13px;
}

.notes-preview-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.markdown-help-link {
    color: #666;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.dark-theme .markdown-help-link {
    color: #bbb;
}

.notes-preview {
    min-height: 180px;
    max-height: 420px;
    margin-top: 10px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.03);
    color: #333;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.notes-preview p,
.notes-preview ul,
.notes-preview ol,
.notes-preview blockquote,
.notes-preview pre,
.notes-preview table,
.history-notes p,
.history-notes ul,
.history-notes ol,
.history-notes blockquote,
.history-notes pre,
.history-notes table {
    margin: 0 0 10px;
}

.notes-preview h1,
.notes-preview h2,
.notes-preview h3,
.history-notes h1,
.history-notes h2,
.history-notes h3 {
    margin: 0 0 10px;
    line-height: 1.2;
}

.notes-preview code,
.history-notes code {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.08);
}

.notes-preview pre,
.history-notes pre {
    overflow-x: auto;
    padding: 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.08);
}

.notes-preview pre code,
.history-notes pre code {
    padding: 0;
    background: transparent;
}

.notes-preview blockquote,
.history-notes blockquote {
    padding-left: 12px;
    border-left: 3px solid #bbb;
    color: #666;
}

.notes-preview table,
.history-notes table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.notes-preview th,
.notes-preview td,
.history-notes th,
.history-notes td {
    padding: 6px;
    border: 1px solid #ddd;
    text-align: left;
}

.notes-preview .markdown-empty {
    color: #888;
    font-style: italic;
}

body.dark-theme .modal-content {
    background: #333;
}

body.dark-theme .notes-editor label {
    color: #bbb;
}

body.dark-theme .notes-preview {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
    color: #eee;
}

body.dark-theme .notes-preview code,
body.dark-theme .history-notes code {
    background: rgba(255, 255, 255, 0.12);
}

body.dark-theme .notes-preview pre,
body.dark-theme .history-notes pre {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .notes-preview blockquote,
body.dark-theme .history-notes blockquote {
    border-left-color: #777;
    color: #bbb;
}

body.dark-theme .notes-preview th,
body.dark-theme .notes-preview td,
body.dark-theme .history-notes th,
body.dark-theme .history-notes td {
    border-color: #555;
}

@media (max-width: 700px) {
    #itemModal .modal-content {
        width: 94%;
        max-width: 94%;
    }

    #modalNotes,
    .notes-preview {
        min-height: 220px;
    }
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#stopFermentBtn {
    background: #f44336;
}

#addToCalendarBtn {
    background: #2f7d57;
}

#closeModalBtn {
    background: #666;
}

/* Calendar export options keep timer and reminder choices scannable in the modal. */
.calendar-export-modal {
    max-width: 460px;
}

.calendar-option-section {
    margin-top: 18px;
    text-align: left;
}

.calendar-option-section h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #555;
}

.calendar-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    margin: 6px 0;
    cursor: pointer;
}

.calendar-checkbox input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.calendar-checkbox span {
    line-height: 1.3;
}

.calendar-custom-reminder {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) minmax(110px, 1.2fr) 42px;
    gap: 8px;
    margin-top: 12px;
}

.calendar-custom-reminder input,
.calendar-custom-reminder select {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.calendar-add-reminder-btn {
    width: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 8px;
    background: #2f7d57;
    font-size: 22px;
    line-height: 1;
}

.calendar-custom-reminder-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.calendar-custom-reminder-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(47, 125, 87, 0.12);
    color: #315f47;
    font-size: 13px;
}

.calendar-remove-reminder-btn {
    width: 22px;
    min-width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    background: #666;
    font-size: 14px;
    line-height: 1;
}

#downloadCalendarBtn {
    background: #2f7d57;
}

#cancelCalendarExportBtn {
    background: #666;
}

body.dark-theme .calendar-option-section h3 {
    color: #ddd;
}

body.dark-theme .calendar-custom-reminder input,
body.dark-theme .calendar-custom-reminder select {
    background: #444;
    color: white;
    border-color: #555;
}

body.dark-theme .calendar-custom-reminder-pill {
    background: rgba(139, 195, 74, 0.16);
    color: #cce9b1;
}

.modal-close-x {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #ff4444;
    background: none;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-x:hover {
    color: #00ff00;
}

.modal-close-x:active {
    transform: scale(0.95);
}

/* Language Modal */
.lang-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.lang-btn {
    padding: 10px;
}

h1, h2 {
    margin-top: 0;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

body.dark-theme .subtitle {
    color: #aaa;
}

/* TABS */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

body.dark-theme .tabs {
    border-bottom: 2px solid #444;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

body.dark-theme .tab-btn {
    color: #aaa;
}

.tab-btn.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
    font-weight: bold;
}

.tab-content {
    min-height: 300px;
}

/* HISTORY CONTROLS */
.history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#exportHistoryBtn {
    background: #2196F3;
}

#importHistoryBtn {
    background: #FF9800;
}

#clearHistoryBtn {
    background: #f44336;
}

/* HISTORY ITEMS */
.history-item {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

body.dark-theme .history-item {
    background: rgba(100, 100, 100, 0.3);
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-name {
    font-weight: bold;
    font-size: 18px;
}

.history-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #666;
    font-size: 14px;
}

body.dark-theme .history-dates {
    color: #aaa;
}

/* History stage styling */
.history-stage {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
    font-style: italic;
}

body.dark-theme .history-stage {
    color: #aaa;
}

.history-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-style: italic;
}

body.dark-theme .history-notes {
    border-top: 1px solid #444;
}

/* Edit History Button */
.edit-history-btn {
    background: none;
    border: none;
    position: relative;
    text-align: right;
    font-size: 10px;
    max-width: 100px;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
}

.edit-history-btn:hover {
    opacity: 0.7;
}

.delete-history-btn {
    background: none;
    border: none;
    font-size: 10px;
    cursor: pointer;
    padding: 5px;
    max-width: 100px;
    color: #f44336;
    transition: opacity 0.3s;
}

.delete-history-btn:hover {
    opacity: 0.7;
}

/* About modal */
.about-info {
    text-align: center;
    margin: 20px 0;
    line-height: 1.6;
}

/* About actions place Donate and Close controls together at the bottom of the modal. */
.about-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.about-actions button {
    flex: 1;
}

#aboutDonateBtn {
    background: #4CAF50;
}

/* History Header */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.edited-badge {
    display: inline-block;
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border: 0;
    border-radius: 3px;
    margin-left: 8px;
    cursor: pointer;
    vertical-align: middle;
}

body.dark-theme .edited-badge {
    color: #aaa;
    background: #333;
}

.edited-badge:hover {
    background: #e0e0e0;
}

body.dark-theme .edited-badge:hover {
    background: #444;
}

/* Edit History Modal */
#editHistoryModal .modal-content {
    max-width: 500px;
}

.info-message {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
}

body.dark-theme .info-message {
    color: #aaa;
    background: #333;
}

/* Sync modal layouts keep QR export, scanning, and import decisions readable on mobile. */
#syncModal {
    background: rgba(0, 0, 0, 0.94);
    align-items: stretch;
    justify-content: stretch;
    --sync-qr-size: min(92vw, 58vh, 520px);
}

.sync-modal-content {
    width: 100vw;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    padding: 18px;
    border-radius: 0;
    background: transparent;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
}

.sync-summary,
.sync-status {
    margin: 12px 0;
    color: #555;
    line-height: 1.4;
}

body.dark-theme .sync-summary,
body.dark-theme .sync-status {
    color: #ddd;
}

#syncModal .modal-subtitle,
#syncModal .sync-summary,
#syncModal .sync-status {
    max-width: 680px;
    text-align: center;
    color: #f2f2f2;
}

.sync-actions,
.sync-scanner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 8px 0;
    width: min(100%, 520px);
}

.sync-rotation-control {
    width: min(100%, 520px);
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) 64px;
    align-items: center;
    gap: 10px;
    color: #f2f2f2;
    font-size: 13px;
}

.sync-rotation-control input {
    width: 100%;
}

.sync-rotation-control output {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sync-qr-codes {
    display: flex;
    justify-content: center;
    width: 100%;
    min-width: 0;
    margin: 8px 0 0;
    order: 10;
    flex: 0 0 auto;
}

#syncModal.sync-scanning .modal-subtitle,
#syncModal.sync-scanning .sync-summary,
#syncModal.sync-scanning .sync-actions,
#syncModal.sync-scanning .sync-rotation-control,
#syncModal.sync-scanning .sync-qr-codes {
    display: none;
}

#syncModal.sync-scanning .sync-status {
    margin: 4px 0;
}

#syncModal.sync-scanning .sync-scanner {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: min(100%, 720px);
}

#syncModal.sync-scanning .sync-scanner video {
    width: min(100%, 720px);
    max-height: 66vh;
    max-height: 66dvh;
    object-fit: contain;
}

.sync-qr-card {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    text-align: center;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.dark-theme .sync-qr-card {
    background: transparent;
}

.sync-qr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.sync-qr-card-header h3 {
    margin: 0;
    font-size: 16px;
}

.sync-qr-card-header span {
    color: #666;
    font-size: 12px;
}

body.dark-theme .sync-qr-card-header span {
    color: #bbb;
}

.sync-qr-frame {
    position: relative;
    width: var(--sync-qr-size);
    height: var(--sync-qr-size);
    max-width: calc(100vw - 24px);
    margin: 0 auto;
    overflow: hidden;
    flex: 0 0 auto;
}

.sync-qr-frame svg {
    display: block;
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    image-rendering: pixelated;
}

.sync-qr-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.sync-qr-progress span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #d2d2d2;
}

.sync-qr-progress span.active {
    background: #4CAF50;
}

.sync-scanner video {
    width: min(100%, 420px);
    border-radius: 8px;
    background: #111;
}

.sync-scanner {
    order: 25;
    width: min(100%, 460px);
}

.sync-scan-progress {
    width: 100%;
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
}

.sync-scan-progress-title {
    margin-bottom: 8px;
    font-size: 13px;
    text-align: center;
}

.sync-scan-progress-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
    gap: 6px;
}

.sync-scan-progress-bar span {
    min-height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #cfcfcf;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.sync-scan-progress-bar span.read {
    border-color: #4CAF50;
    background: #4CAF50;
    color: #fff;
}

.sync-import-choice {
    margin: 18px 0;
    padding: 14px;
    border: 1px solid #f0ad4e;
    border-radius: 8px;
    background: #fff8e7;
    color: #2f2614;
    max-width: min(100%, 680px);
    text-align: center;
}

body.dark-theme .sync-import-choice {
    border-color: #9a6b16;
    background: #2b2414;
    color: #fff3d8;
}

.sync-import-choice p {
    margin-top: 0;
}

.sync-import-choice .danger {
    background: #f44336;
}

.sync-close-x {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 2100;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d90429;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-close-x:hover,
.sync-close-x:focus {
    background: #ff1744;
}

@media (max-width: 520px) {
    #syncModal {
        --sync-qr-size: min(94vw, 46vh);
    }

    .sync-modal-content {
        width: 100vw;
        padding: 56px 8px 12px;
        gap: 6px;
    }

    .sync-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .sync-actions button {
        min-width: 0;
        padding: 8px 6px;
        font-size: 12px;
    }

    .sync-rotation-control {
        grid-template-columns: 1fr auto;
        width: calc(100vw - 16px);
    }

    .sync-rotation-control input {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .sync-qr-codes {
        min-height: 0;
        margin: 4px 0 0;
    }

    .sync-qr-card {
        padding: 0;
    }

    .sync-qr-card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .sync-qr-frame {
        width: var(--sync-qr-size);
        height: var(--sync-qr-size);
        max-width: calc(100vw - 16px);
        min-width: 0;
    }

    #syncModal.sync-scanning .sync-scanner {
        width: calc(100vw - 16px);
    }

    #syncModal.sync-scanning .sync-scanner video {
        width: calc(100vw - 16px);
        max-height: 68vh;
        max-height: 68dvh;
    }

}

.original-data {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

body.dark-theme .original-data {
    background: #333;
}

.original-data p {
    margin: 5px 0;
}

/* Alert Modal Specific Styles */
#alertModal .modal-content {
  text-align: center;
  max-width: 350px;
}

#alertMessage {
  margin-bottom: 20px;
  line-height: 1.5;
  font-size: 16px;
  color: #333;
}

body.dark-theme #alertMessage {
  color: #eee;
}

#alertOkBtn {
  background: #4CAF50;
  min-width: 80px;
}

#alertCancelBtn {
  background: #f44336;
  min-width: 80px;
}

/* Ensure alert modal buttons are properly spaced */
#alertModal .modal-buttons {
  justify-content: center;
  gap: 15px;
}
