:root {
    --page-bg: #b8d0b3;          
    --text: #2c3e35;              
    --container-bg: #fffff0; 
    --container-border: #749d6e;           
    --textbox-bg: #ffffff;         
    --parchment: #fffce8;          
    --paper-border: #dee7d4;            
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--page-bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Header */
.header-container {
    width: 100%;
    max-width: 1050px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--container-bg);
    padding: 12px 20px;
    border-radius: 14px;
    border: 2px solid var(--container-border);
    box-shadow: 0 4px 12px rgba(61, 35, 20, 0.08);
    margin-bottom: 20px;
}

.header-title { font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }

/* Workspace Layout */
.workspace-container {
    width: 100%;
    max-width: 1050px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: var(--container-bg);
    border: 2px solid var(--container-border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(61, 35, 20, 0.06);
}

.panel h3 { font-size: 1.15rem; margin-bottom: 20px; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.form-input {
    width: 33%; font-family: 'Quicksand', sans-serif; padding: 8px 10px;
    border-radius: 8px; border: 2px solid var(--text); background: #fff;
    font-size: 1rem; font-weight: 700; color: var(--text);
}
.input-hint { display: block; font-size: 0.7rem; opacity: 0.65; margin-top: 3px; }

/* Force number input spinner arrows to stay visible even when readonly */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: inner-spin-button !important;
    opacity: 1 !important;
    display: block !important;
    cursor: pointer;
}




.tracker-controls { display: flex; align-items: center; justify-content: flex-start; gap: 6px; }
#row-display { font-size: 1.2rem; font-weight: 700; min-width: 60px; }

#row-reset {
    margin-left: 36px; /* Pushes the Reset button further away from the + button */
    font-size: 0.85rem;
    padding: 4px 8px;
}

/* Buttons */
.btn {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 8px; 
    border: 2px solid var(--text);
    cursor: pointer; 
    transition: all 0.15s ease;
    background-color: var(--container-border);
    color: var(--textbox-bg);
    border-color: var(--paper-border);
}

.btn:hover { 
    filter: brightness(1.15); 
    transform: translateY(-1px); 
}


/* Pattern Paper Sheet */
.pattern-paper {
    background: var(--parchment);
    border: 2px solid var(--paper-border);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 6px 20px rgba(44, 62, 53, 0.12);
}

.pattern-heading { font-size: 1.8rem; font-weight: 700; margin-bottom: 2px; color: var(--text); }

.pattern-section { margin-bottom: 18px; }
.pattern-section h4 { font-size: 1rem; font-weight: 700; border-bottom: 1.5px solid #eee; padding-bottom: 4px; margin-bottom: 8px; }
.pattern-section ul { padding-left: 18px; font-size: 0.9rem; opacity: 0.85; line-height: 1.5; }





.instruction-step { font-size: 1.05rem; line-height: 1.6; margin-bottom: 10px; }
.dynamic-val {
    background: #fcf191;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    border: 1px solid #e2d362;
}

/* Instruction Step Layout with Checkbox */
.instruction-step-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding: 6px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.instruction-step-row:hover {
    background-color: var(--paper-border);
}

/* Custom Cozy Checkbox */
.step-checkbox-label {
    position: relative;
    cursor: pointer;
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    flex-shrink: 0;
}

.step-checkbox-label input {
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-checkbox {
    position: absolute;
    top: 0; left: 0;
    width: 22px; height: 22px;
    background-color: var(--textbox-bg);
    border: 2px solid var(--text);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.step-checkbox-label:hover .custom-checkbox {
    border-color: var(--container-border);
}

.step-checkbox-label input:checked ~ .custom-checkbox {
    background-color: var(--container-border);
    border-color: var(--text);
}

.step-checkbox-label input:checked ~ .custom-checkbox::after {
    content: "✓";
    position: absolute;
    color: var(--textbox-bg);
    font-weight: bold;
    font-size: 14px;
    left: 4px;
    top: -1px;
}

/* Dim completed steps slightly for visual satisfaction */
.instruction-step-row.completed .instruction-step {
    opacity: 0.55;
    text-decoration: line-through;
    text-decoration-color: var(--box-bg);
}

.instruction-step-row.completed .dynamic-val {
    background: #e8e2c0;
    opacity: 0.8;
}


/* Cozy Cutesy Speech Bubble */
.form-group {
    position: relative; /* Keeps bubble tied to the input field */
}

.input-bubble {
    position: absolute;
    top: 18px;
    left: 115px; /* Sits neatly right beside the input box */
    background-color: var(--parchment); /* Soft parchment/canvas bg */
    color: var(--text);                  /* Deep forest green text */
    border: 2px solid var(--text);      /* Crisp matching border */
    padding: 8px 14px;                   /* Roomy, cozy padding */
    border-radius: 12px;                 /* Extra rounded edges */
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(44, 62, 53, 0.12);
    pointer-events: none;
    z-index: 10;
    animation: cutesyPop 2.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Little speech bubble tail pointing left toward the text box */
.input-bubble::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background-color: var(--parchment);
    border-left: 2px solid var(--text);
    border-bottom: 2px solid var(--text);
}

/* Playful springy pop-in & gentle fade-out */
@keyframes cutesyPop {
    0% {
        opacity: 0;
        transform: scale(0.85) translateX(-8px);
    }
    15% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
    80% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.9) translateY(-6px);
    }
}


/* Cozy Tips & Ideas Box */
.tips-box {
    background-color: var(--parchment);
    border: 2px dashed var(--text); /* Dashed border gives it a charming cut-out/notebook feel */
    border-radius: 14px;
    padding: 16px 20px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(44, 62, 53, 0.06);
}

.tips-header {
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tips-list {
    margin: 0;
    padding-left: 20px;
    font-style: italic;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
}

.tips-list li {
    margin-bottom: 6px;
}

.tips-list li:last-child {
    margin-bottom: 0;
}


/* Navigation */
.nook-nav {
    width: 100%;
    max-width: 1050px;
    margin-bottom: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background-color: var(--parchment);
    border: 1.5px solid rgba(74, 40, 0, 0.12);
    border-radius: 14px;
    color: #4A2800;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 0 rgba(74, 40, 0, 0.08);
    transition: transform 0.15s ease;
}