/* =========================
   Common Components
========================= */

.page-title {
    text-align: center;
    margin-bottom: 24px;
}

.page-title h1 {
    margin: 0;
    font-size: 36px;
    font-style: italic;
}

.page-title p {
    margin-top: 8px;
    color: #7a6c5d;
}

/* Card */

.common-card {
    background: #fffdf8;
    border: 1px solid #eadcc8;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 18px rgba(87, 64, 38, 0.05);
}

/* Buttons */

.main-button,
.sub-button,
.danger-button,
.dark-button {
    display: inline-block;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    font-weight: 700;
    border-radius: 12px;
    padding: 11px 18px;
    font-size: 14px;
}

.main-button {
    background: #2f2a24;
    color: white;
}

.sub-button {
    background: #f0dfc6;
    color: #2f2a24;
}

.danger-button {
    background: #ffe3dc;
    color: #b5422f;
}

.dark-button {
    background: #2f2a24;
    color: white;
}

.main-button:hover,
.dark-button:hover {
    background: #1f1a16;
}

.sub-button:hover {
    background: #e7d3b7;
}

.danger-button:hover {
    background: #ffd1c6;
}

/* Form */

input,
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #eadcc8;
    border-radius: 14px;
    padding: 13px 14px;
    background: #fffdf8;
    color: #2f2a24;
    font-family: inherit;
    font-size: 15px;
}

textarea {
    resize: vertical;
    line-height: 1.6;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #c9a874;
    box-shadow: 0 0 0 3px rgba(201, 168, 116, 0.18);
}

label {
    font-weight: 700;
    color: #5f5143;
}

/* Utility */

.text-muted {
    color: #7a6c5d;
}

.section-divider {
    height: 1px;
    background: #eadcc8;
    margin: 20px 0;
}
/* Auth UI */
.sidebar-user-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding: 16px 6px 0;
    border-top: 1px solid #EADCC8;
    background: transparent;
}

.sidebar-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sidebar-user-avatar {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #F0DFC6;
    color: #5F5143;
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
}

.sidebar-user-meta {
    min-width: 0;
    flex: 1;
}

.sidebar-user-meta strong {
    display: block;
    overflow: hidden;
    max-width: 100%;
    color: #2F2A24;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-meta span {
    display: block;
    margin-top: 3px;
    color: #8A7D6E;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-logout-button {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid #E4D6C2;
    border-radius: 12px;
    background: #FFFDF8;
    color: #7A6C5D;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.sidebar-logout-button:hover {
    background: #F5EBDD;
    border-color: #DCC9AD;
    color: #2F2A24;
}

.flash-messages {
    margin: 0 0 18px;
}

.flash-message {
    padding: 13px 16px;
    border-radius: 16px;
    background: #F8FCF5;
    border: 1px solid #DDE8D6;
    color: #5F6D4C;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Global flash toast: show once and disappear automatically */
.flash-toast-stack {
    position: fixed;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.flash-toast {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 210px;
    padding: 13px 20px;
    border: 1px solid #d9e4ce;
    border-radius: 999px;
    background: #fffdf8;
    color: #5f7445;
    font-weight: 850;
    box-shadow: 0 12px 28px rgba(73, 59, 39, 0.14);
    opacity: 1;
    transform: translateY(0);
    transition: opacity .28s ease, transform .28s ease;
}

.flash-toast.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}


/* Shared information tooltip */
.prompt-title-with-info,
.daily-card-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.daily-card-title-row {
    margin: 0 0 14px;
}

.daily-card-title-row > p {
    margin: 0 !important;
}

.info-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 20;
}

.info-tooltip-button {
    width: 19px;
    height: 19px;
    padding: 0;
    border: 1px solid #b9c9ad;
    border-radius: 50%;
    background: rgba(255, 255, 255, .78);
    color: #61754b;
    font-family: "Inter", sans-serif;
    font-size: 11px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.info-tooltip-button:hover,
.info-tooltip-button[aria-expanded="true"] {
    background: #6e8451;
    border-color: #6e8451;
    color: #fff;
    transform: translateY(-1px);
}

.info-tooltip-panel {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    width: 285px;
    padding: 14px 15px;
    border: 1px solid #e2d5c2;
    border-radius: 13px;
    background: #fffdf8;
    color: #625545;
    box-shadow: 0 14px 32px rgba(67, 51, 32, .14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    pointer-events: none;
}

.info-tooltip-wrap.is-open .info-tooltip-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.info-tooltip-panel strong {
    display: block;
    margin-bottom: 5px;
    color: #4f633d;
    font-size: 13px;
}

.info-tooltip-panel p {
    margin: 0 !important;
    color: #746654 !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1.55 !important;
}

@media (max-width: 760px) {
    .info-tooltip-panel {
        width: min(270px, calc(100vw - 56px));
    }
}


/* First-visit feedback mode onboarding */
.feedback-mode-onboarding{position:fixed;inset:0;z-index:10020;display:grid;place-items:center;padding:24px;box-sizing:border-box}.feedback-mode-onboarding-backdrop{position:absolute;inset:0;background:rgba(41,36,30,.58);backdrop-filter:blur(5px)}.feedback-mode-onboarding-card{position:relative;width:min(760px,100%);max-height:calc(100vh - 48px);overflow:auto;box-sizing:border-box;padding:34px;background:#fffdf8;border:1px solid #eadcc8;border-radius:28px;box-shadow:0 28px 80px rgba(31,25,20,.25)}.feedback-mode-onboarding-heading{text-align:center;margin-bottom:24px}.feedback-mode-onboarding-eyebrow{font:800 11px/1 var(--font-en);letter-spacing:.16em;color:#718954}.feedback-mode-onboarding-heading h2{margin:10px 0 8px;font-size:27px;letter-spacing:-.035em;color:#2f2a24}.feedback-mode-onboarding-heading p{margin:0;color:#817263;font-size:14px}.feedback-mode-onboarding-options{display:grid;grid-template-columns:1fr 1fr;gap:14px}.feedback-mode-onboarding-option{position:relative;display:grid;grid-template-columns:44px 1fr;gap:13px;align-items:start;text-align:left;border:1px solid #e5d9ca;background:#fff;border-radius:20px;padding:20px;cursor:pointer;font:inherit;color:inherit;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,background .18s ease}.feedback-mode-onboarding-option:hover{transform:translateY(-2px);border-color:#8fa574;background:#fafdf7;box-shadow:0 12px 24px rgba(80,98,60,.1)}.feedback-mode-onboarding-icon{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:#f1f5eb;color:#657d4c}.feedback-mode-onboarding-icon svg{width:21px;height:21px}.feedback-mode-onboarding-copy strong,.feedback-mode-onboarding-copy em,.feedback-mode-onboarding-copy small{display:block}.feedback-mode-onboarding-copy strong{font:800 18px/1.2 var(--font-en)}.feedback-mode-onboarding-copy em{margin-top:6px;font:700 13px/1.35 var(--font-en);font-style:normal;color:#667d4f}.feedback-mode-onboarding-copy small{margin-top:10px;color:#786a5d;line-height:1.65;font-size:13px}.feedback-mode-onboarding-tag{grid-column:2;justify-self:start;margin-top:2px;padding:6px 9px;border-radius:999px;background:#edf4e7;color:#5f7848;font-size:11px;font-weight:800}.feedback-mode-onboarding-note{display:flex;justify-content:center;align-items:center;gap:7px;margin:20px 0 0;color:#8b7c6d;font-size:13px}.feedback-mode-onboarding-note svg{width:15px;height:15px}@media(max-width:700px){.feedback-mode-onboarding-card{padding:25px 20px}.feedback-mode-onboarding-heading h2{font-size:23px}.feedback-mode-onboarding-options{grid-template-columns:1fr}.feedback-mode-onboarding-option{padding:17px}}

/* =========================================================
   Mobile viewport-safe shared tooltips
   Used by write, edit and index prompt help buttons.
========================================================= */
@media (max-width: 760px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .info-tooltip-wrap {
        position: relative;
        min-width: 0;
    }

    .info-tooltip-panel.mobile-viewport-tooltip {
        position: fixed;
        z-index: 10050;
        top: var(--mobile-tooltip-top, 80px);
        left: var(--mobile-tooltip-left, 16px);
        right: auto;
        width: var(--mobile-tooltip-width, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
        box-sizing: border-box;
        padding: 13px 14px;
        margin: 0;
        overflow: visible;
        overflow-wrap: anywhere;
        word-break: keep-all;
        white-space: normal;
        transform: translateY(-4px);
    }

    .info-tooltip-wrap.is-open .info-tooltip-panel.mobile-viewport-tooltip {
        transform: translateY(0);
    }

    .info-tooltip-panel.mobile-viewport-tooltip strong {
        display: block;
        margin: 0 0 6px !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
        letter-spacing: -0.02em;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .info-tooltip-panel.mobile-viewport-tooltip p {
        margin: 0 !important;
        font-size: 12px !important;
        line-height: 1.6 !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
}
