/* Checklist plugin — modernized UI.
 * Uses the babyforum design tokens (var(--color-*) / var(--font-*)) with hex
 * fallbacks; the completion green (#6BBF8A) stays bespoke to the checklist.
 */

.ChecklistPage {
    max-width: 1000px;
    margin: 0 auto;
}

/* Page header ----------------------------------------------------------- */
.ChecklistHead {
    margin-bottom: 18px;
}

.ChecklistTitle,
.ChecklistPage h1.H {
    font-family: var(--font-heading, 'Fraunces', serif);
    font-size: 28px;
    line-height: 1.2;
    color: var(--color-primary, #344254);
    margin: 0 0 4px;
}

.ChecklistIntro,
.ChecklistHeadSub {
    color: #838c96;
    max-width: 640px;
    margin: 0 0 14px;
}

.ChecklistMuted {
    color: #8aa0b6;
    font-size: .85rem;
}

/* Buttons --------------------------------------------------------------- */
.ChecklistBtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.ChecklistBtn .ChecklistIcon {
    width: 16px;
    height: 16px;
}

.ChecklistBtn--primary {
    background: var(--color-accent, #EA6D86);
    color: var(--color-surface, #fff);
    box-shadow: 0 6px 16px rgba(234, 109, 134, .25);
}

.ChecklistBtn--primary:hover {
    background: #e0556f;
    color: var(--color-surface, #fff);
    transform: translateY(-1px);
}

.ChecklistBtn--ghost {
    background: var(--color-surface, #fff);
    color: var(--color-primary, #344254);
    border-color: #e2e8f0;
}

.ChecklistBtn--ghost:hover {
    border-color: var(--color-link, #4fc6de);
    color: var(--color-text, #2b2e3d);
    background: #f3fbfd;
    transform: translateY(-1px);
}

.ChecklistBtn--danger {
    background: var(--color-surface, #fff);
    color: #c0556b;
    border-color: #f0d3da;
}

.ChecklistBtn--danger:hover {
    background: #fdeef1;
    border-color: var(--color-accent, #EA6D86);
}

/* Circular icon buttons ------------------------------------------------- */
.ChecklistIconBtn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-border, #BFCAD9);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.ChecklistIconBtn .ChecklistIcon {
    width: 18px;
    height: 18px;
}

.ChecklistIconBtn:hover {
    background: rgba(79, 198, 222, .14);
    color: var(--color-primary, #344254);
}

.ChecklistIconBtn-danger:hover {
    background: rgba(234, 109, 134, .14);
    color: var(--color-accent, #EA6D86);
}

/* Drag handle ----------------------------------------------------------- */
.ChecklistDragHandle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #c2cdda;
    cursor: grab;
    transition: color .15s ease;
}

.ChecklistDragHandle:active {
    cursor: grabbing;
}

.ChecklistDragHandle:hover {
    color: #8aa0b6;
}

.ChecklistDragHandle .ChecklistIcon-grip {
    width: 18px;
    height: 18px;
}

/* Action bar ------------------------------------------------------------ */
.ChecklistActions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 14px 0 22px;
}

.ChecklistInlineForm {
    display: inline;
    margin: 0;
}

/* Overview / profile cards --------------------------------------------- */
.ChecklistCards {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.ChecklistCard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--color-surface, #fff);
    border: 1px solid #e4e9ed;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(27, 39, 51, .04);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.ChecklistCard:hover {
    box-shadow: 0 12px 30px rgba(27, 39, 51, .10);
    border-color: #cfd9e0;
    transform: translateY(-2px);
}

.ChecklistCardLink {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: var(--color-primary, #344254);
}

.ChecklistCardTitle {
    font-family: var(--font-heading, 'Fraunces', serif);
    font-size: 18px;
    line-height: 1.3;
    color: var(--color-primary, #344254);
    transition: color .15s ease;
}

.ChecklistCard:hover .ChecklistCardTitle {
    color: var(--color-accent, #EA6D86);
}

.ChecklistCardMeta {
    font-size: 12px;
    color: #838c96;
}

.ChecklistCardFooter {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 2px;
}

.ChecklistCardEdit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7680;
    text-decoration: none;
}

.ChecklistCardEdit .ChecklistIcon {
    width: 14px;
    height: 14px;
}

.ChecklistCardEdit:hover {
    color: var(--color-accent, #EA6D86);
}

/* Badges ---------------------------------------------------------------- */
.ChecklistBadge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.ChecklistBadge .ChecklistIcon {
    width: 12px;
    height: 12px;
}

.ChecklistBadgePublic {
    background: rgba(79, 198, 222, .18);
    color: #2a93a8;
}

.ChecklistBadgePrivate {
    background: rgba(131, 140, 150, .16);
    color: #5b6770;
}

/* Progress bar ---------------------------------------------------------- */
.ChecklistProgressRow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ChecklistProgressRow .ChecklistProgressBar {
    flex: 1 1 auto;
}

.ChecklistProgressBar {
    display: block;
    height: 8px;
    border-radius: var(--radius-full);
    background: #eef2f5;
    overflow: hidden;
}

.ChecklistProgressFill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--color-link, #4fc6de), var(--color-accent, #EA6D86));
    transition: width .3s ease;
}

.ChecklistProgressPct {
    flex: 0 0 auto;
    min-width: 34px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary, #344254);
}

/* View page ------------------------------------------------------------- */
.ChecklistSummary {
    max-width: 460px;
    margin: 6px 0 20px;
}

.ChecklistSummaryText {
    display: block;
    font-size: 13px;
    color: #5b6770;
    margin-bottom: 8px;
}

.ChecklistCategories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ChecklistCategoryCard {
    background: var(--color-surface, #fff);
    border: 1px solid #e7eef5;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(27, 39, 51, .04);
}

.ChecklistCategoryHead {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.ChecklistCategoryTitle {
    flex: 1 1 auto;
    font-family: var(--font-heading, 'Fraunces', serif);
    font-size: 18px;
    color: var(--color-primary, #344254);
    margin: 0;
}

.ChecklistCatCount {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-muted, #7e96b3);
    background: #f1f5f9;
    border-radius: var(--radius-full);
    padding: 3px 10px;
}

/* Items + custom checkbox ---------------------------------------------- */
.ChecklistItems {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 22px;
}

.ChecklistEmptyItem {
    grid-column: 1 / -1;
    color: #9aa4ad;
    font-style: italic;
    font-size: 14px;
}

.ChecklistCheck {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0;
    padding: 6px 0;
    cursor: pointer;
    line-height: 1.45;
}

.ChecklistItemReadonly .ChecklistCheck {
    cursor: default;
}

.ChecklistToggle {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.ChecklistCheckBox {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 2px solid #d4dde7;
    border-radius: 7px;
    background: var(--color-surface, #fff);
    color: var(--color-surface, #fff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.ChecklistCheckBox .ChecklistIcon {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(.4);
    transition: opacity .15s ease, transform .15s ease;
}

.ChecklistItem:not(.ChecklistItemReadonly) .ChecklistCheck:hover .ChecklistCheckBox {
    border-color: var(--color-link, #4fc6de);
}

.ChecklistToggle:focus-visible + .ChecklistCheckBox {
    box-shadow: 0 0 0 3px rgba(79, 198, 222, .35);
}

.ChecklistItemDone .ChecklistCheckBox {
    background: #6BBF8A;
    border-color: #6BBF8A;
}

.ChecklistItemDone .ChecklistCheckBox .ChecklistIcon {
    opacity: 1;
    transform: scale(1);
}

.ChecklistItemLabel {
    flex: 1 1 auto;
    color: #3b4a5c;
}

.ChecklistItemDone .ChecklistItemLabel {
    text-decoration: line-through;
    color: #9bb0c6;
}

/* Edit / builder page --------------------------------------------------- */
.ChecklistMetaCard {
    background: var(--color-bg, #f6f9fc);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 18px;
}

.ChecklistField {
    margin-bottom: 14px;
}

.ChecklistMetaCard label,
.ChecklistFieldLabel {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #565b70;
    margin-bottom: 6px;
}

.ChecklistFieldCheck {
    margin-top: 6px;
}

.ChecklistFormFooter {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ChecklistSectionTitle {
    font-family: var(--font-heading, 'Fraunces', serif);
    font-size: 20px;
    color: var(--color-primary, #344254);
    margin: 26px 0 12px;
}

.ChecklistCategoryEdit {
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.ChecklistCategoryEdit .ChecklistCategoryHead {
    margin-bottom: 12px;
}

.ChecklistCategoryInput {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-heading, 'Fraunces', serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary, #344254);
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    padding: 4px 2px;
}

.ChecklistCategoryInput:focus {
    outline: none;
    border-bottom-color: var(--color-link, #4fc6de);
}

.ChecklistItemsEdit {
    display: block;
    list-style: none;
    margin: 0 0 6px;
    padding: 0;
}

.ChecklistItemEdit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.ChecklistItemEdit .ChecklistItemLabel {
    flex: 1 1 auto;
    min-width: 0;
}

/* Dashed add buttons ---------------------------------------------------- */
.ChecklistAddBtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px dashed #c5d0dd;
    border-radius: 10px;
    background: var(--color-surface, #fff);
    color: var(--color-primary, #344254);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.ChecklistAddBtn:hover {
    border-color: var(--color-link, #4fc6de);
    color: var(--color-text, #2b2e3d);
    background: #f3fbfd;
}

.ChecklistAddBtn .ChecklistIcon {
    width: 15px;
    height: 15px;
}

.ChecklistAddBtn--block {
    width: 100%;
    justify-content: center;
    padding: 12px;
    border-color: #f0c6cf;
    color: #c0556b;
}

.ChecklistAddBtn--block:hover {
    border-color: var(--color-accent, #EA6D86);
    color: #c0556b;
    background: #fdeef1;
}

.ChecklistAddItem {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.ChecklistAddItem .ChecklistNewItem {
    flex: 1 1 auto;
    min-width: 0;
}

.ChecklistAddCategory {
    margin: 18px 0;
}

.ChecklistAddCategoryRow {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.ChecklistAddCategoryRow .ChecklistNewCategory {
    flex: 1 1 auto;
    min-width: 0;
}

/* Sortable feedback ----------------------------------------------------- */
.ChecklistSortPlaceholder {
    border: 2px dashed #f3c7d2;
    border-radius: 10px;
    background: #fff6f8;
    margin: 6px 0;
}

.ChecklistDragging {
    box-shadow: 0 16px 34px rgba(27, 39, 51, .18) !important;
    border-color: #f0c6cf !important;
}

/* Danger zone ----------------------------------------------------------- */
.ChecklistDangerZone {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid #eef2f6;
}

/* Empty state ----------------------------------------------------------- */
.ChecklistEmpty {
    text-align: center;
    padding: 40px 16px;
    color: #838c96;
    background: #f7f9fa;
    border: 1px solid #eef2f6;
    border-radius: 14px;
}

/* Discussion embed ------------------------------------------------------ */
.ChecklistEmbed {
    background: #f9fbfd;
    border: 1px solid #e7eef5;
    border-radius: 14px;
    padding: 16px;
    margin: 14px 0;
}

.ChecklistEmbedTitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading, 'Fraunces', serif);
    color: var(--color-primary, #344254);
    margin: 0 0 12px;
}

.ChecklistEmbedTitle .ChecklistIcon {
    width: 18px;
    height: 18px;
    color: var(--color-accent, #EA6D86);
}

.ChecklistEmbedCategories {
    display: grid;
    gap: 12px;
}

.ChecklistEmbed .ChecklistCategoryCard {
    box-shadow: none;
    border: 1px solid #eef2f6;
    padding: 12px 14px;
}

/* Inputs in checklist scope -------------------------------------------- */
.ChecklistPage .InputBox {
    border-radius: 10px;
}

/* Mobile: single column items ------------------------------------------ */
@media (max-width: 768px) {
    .ChecklistItems {
        grid-template-columns: 1fr;
    }

    .ChecklistTitle,
    .ChecklistPage h1.H {
        font-size: 24px;
    }
}
