/* Mains v4 workspace — sidebar calendar, browse/write modes */
body:has(.mains-v4-app) .main-container {
    max-width: none;
}

#feed-container.mains-v4-tab {
    padding: 0;
    height: calc(100dvh - var(--header-total, 58px) - var(--nav-total, 64px));
    max-height: calc(100dvh - var(--header-total, 58px) - var(--nav-total, 64px));
    overflow: hidden;
    background: #F9F8F5;
}

body:has(.mains-v4-app) {
    overflow: hidden;
}

.mains-v4-app,
.mains-v4-app * {
    box-sizing: border-box;
}

.mains-v4-app {
    display: flex;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    color: #1C1C1A;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    background: #F9F8F5;
}

.mains-v4-app.focus-mode .mains-v4-sidebar {
    display: none;
}

.mains-v4-app.focus-mode .mains-v4-write-right {
    width: 300px;
}

.mains-v4-app.focus-mode .mains-v4-write-left {
    flex: 1;
    min-width: 0;
}

/* Sidebar */
.mains-v4-sidebar {
    width: 236px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #E0DDD6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    height: 100%;
    transition: all .2s;
    z-index: 4;
}

.mains-v4-sb-top {
    padding: 12px 12px 0;
    flex-shrink: 0;
}

.mains-v4-cal-widget {
    border: 1px solid #E8E5DE;
    border-radius: 12px;
    padding: 8px 8px 6px;
    margin-bottom: 10px;
    background: #fff;
}

.mains-v4-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 6px;
}

.mains-v4-cal-nav-btn {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 6px;
    background: #F3F2EF;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.mains-v4-cal-nav-btn:hover {
    background: #E8E5DE;
    color: #1C1C1A;
}

.mains-v4-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.mains-v4-cal-weekdays span {
    text-align: center;
    font-size: 8px;
    font-weight: 700;
    color: #aaa;
    letter-spacing: .2px;
    text-transform: uppercase;
}

.mains-v4-cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mains-v4-cal-month-grid .mains-v4-cal-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 2px 0 4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: #333;
}

.mains-v4-cal-month-grid .mains-v4-cal-cell .d {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.mains-v4-cal-month-grid .mains-v4-cal-cell:hover .d {
    background: #F0EDE6;
}

.mains-v4-cal-month-grid .mains-v4-cal-cell.ghost {
    color: #ccc;
    cursor: pointer;
}

.mains-v4-cal-month-grid .mains-v4-cal-cell.active .d {
    background: #2563EB;
    color: #fff;
    font-weight: 700;
}

.mains-v4-cal-month-grid .mains-v4-cal-cell.has-q .mains-v4-cal-dot {
    display: block;
}

.mains-v4-cal-dot {
    display: none;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #2563EB;
    margin-top: 1px;
}

.mains-v4-cal-month-grid .mains-v4-cal-cell.active .mains-v4-cal-dot {
    background: #fff;
}

.mains-v4-cal-label {
    flex: 1;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #444;
    letter-spacing: .4px;
    margin-bottom: 0;
    text-transform: uppercase;
}

.mains-v4-cal-strip {
    display: none;
}

.mains-v4-cats-box {
    border: 1px solid #E0DDD6;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
    background: #FAFAF8;
}

.mains-v4-sb-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.mains-v4-cal-day {
    flex: 1;
    text-align: center;
    padding: 5px 2px;
    border-radius: 7px;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    font: inherit;
    color: inherit;
}

.mains-v4-cal-day:hover {
    background: #F9F8F5;
}

.mains-v4-cal-day .dn {
    font-size: 9px;
    color: #aaa;
    display: block;
    margin-bottom: 2px;
}

.mains-v4-cal-day .dd {
    font-size: 12px;
    font-weight: 600;
    color: #444;
    display: block;
}

.mains-v4-cal-day.active {
    background: #1C1C1A;
    border-color: #1C1C1A;
}

.mains-v4-cal-day.active .dn,
.mains-v4-cal-day.active .dd {
    color: #fff;
}

.mains-v4-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0;
}

.mains-v4-cat {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #E0DDD6;
    color: #666;
    background: #fff;
    transition: all .15s;
    font-family: inherit;
}

.mains-v4-cat:hover {
    border-color: #1C1C1A;
    color: #1C1C1A;
}

.mains-v4-cat.active {
    background: #1C1C1A;
    color: #fff;
    border-color: #1C1C1A;
}

.mains-v4-sb-section {
    font-size: 9px;
    font-weight: 700;
    color: #bbb;
    letter-spacing: .5px;
    padding: 4px 12px 6px;
    text-transform: uppercase;
}

.mains-v4-q-list {
    flex: 1;
    overflow: visible;
    padding: 0 8px 8px;
}

.mains-v4-q-card {
    padding: 9px 10px;
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s;
    width: 100%;
    text-align: left;
    background: transparent;
    font: inherit;
    color: inherit;
}

.mains-v4-q-card:hover {
    background: #F9F8F5;
    border-color: #E0DDD6;
}

.mains-v4-q-card.active-q {
    background: #F0EDE6;
    border-color: #D4CFBF;
}

.mains-v4-q-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}

.mains-v4-q-subject {
    font-size: 10px;
    font-weight: 700;
    color: #777;
}

.mains-v4-q-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mains-v4-q-dot.p { background: #D4860F; }
.mains-v4-q-dot.w { background: #3B7D2E; }
.mains-v4-q-dot.e { background: #2563EB; }

.mains-v4-q-st {
    font-size: 10px;
    font-weight: 600;
}

.mains-v4-q-st.p { color: #D4860F; }
.mains-v4-q-st.w { color: #3B7D2E; }
.mains-v4-q-st.e { color: #2563EB; }

.mains-v4-q-prev {
    font-size: 11.5px;
    color: #555;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mains-v4-upsell {
    margin: 8px 10px 10px;
    border-radius: 10px;
    background: #0F1F1E;
    padding: 11px 12px;
    flex-shrink: 0;
}

.mains-v4-upsell-head {
    font-size: 9px;
    font-weight: 800;
    color: #4DC9B8;
    letter-spacing: .5px;
    margin-bottom: 3px;
}

.mains-v4-upsell p {
    font-size: 10px;
    color: #7AADA8;
    line-height: 1.5;
    margin: 0 0 7px;
}

.mains-v4-upsell-price {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 7px;
}

.mains-v4-upsell-price em {
    font-size: 10px;
    font-weight: 400;
    font-style: normal;
    color: #5E9590;
}

.mains-v4-upsell-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #1E8A7A;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    border: 0;
    font-family: inherit;
}

.mains-v4-upsell-btn:hover {
    background: #167060;
}

.mains-v4-upsell-mobile {
    display: none;
    margin: 14px 0 0;
}

/* Main area */
.mains-v4-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.mains-v4-browse {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 20px 24px;
    min-height: 0;
}

.mains-v4-browse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 10px;
    flex-wrap: wrap;
}

.mains-v4-browse-title {
    font-size: 15px;
    font-weight: 700;
    color: #1C1C1A;
    margin: 0;
}

.mains-v4-browse-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mains-v4-browse-count {
    font-size: 11px;
    background: #EDE9E0;
    color: #666;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.mains-v4-focus-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 7px;
    border: 1px solid #E0DDD6;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    font-family: inherit;
}

.mains-v4-focus-btn:hover {
    background: #F9F8F5;
    border-color: #C8C3B8;
}

.mains-v4-focus-btn svg {
    width: 13px;
    height: 13px;
}

.mains-v4-bq-card {
    background: #fff;
    border: 1px solid #E0DDD6;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 10px;
    transition: all .15s;
}

.mains-v4-bq-card:hover {
    border-color: #C8C3B8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.mains-v4-bq-tags,
.mains-v4-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.mains-v4-meta-box {
    border: 1px solid #E0DDD6;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 12px;
    background: #FAFAF8;
}

.mains-v4-bq-tag.cat { background: #FFF3E0; color: #A05E00; }

.mains-v4-bq-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.mains-v4-bq-tag {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
}

.mains-v4-bq-tag.marks { background: #1C1C1A; color: #fff; }
.mains-v4-bq-tag.words { background: #F0EDE6; color: #666; border: 1px solid #E0DDD6; }
.mains-v4-bq-tag.sub { background: #EBF3FF; color: #1A5CA8; }
.mains-v4-bq-tag.st-p { background: #FFF3E0; color: #A05E00; }
.mains-v4-bq-tag.st-w { background: #EDFBF0; color: #1E6B30; }
.mains-v4-bq-tag.st-e { background: #EFF6FF; color: #1D4ED8; }

.mains-v4-bq-qtext {
    font-family: Georgia, serif;
    font-size: 15px;
    line-height: 1.75;
    color: #1C1C1A;
    margin-bottom: 14px;
}

.mains-v4-directive-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #EEF5FF;
    border: 1px solid #C8D8F0;
    border-radius: 8px;
    padding: 10px 13px;
    margin-bottom: 14px;
}

.mains-v4-directive-box svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #2563EB;
}

.mains-v4-d-label {
    font-size: 10px;
    font-weight: 800;
    color: #1A3C8A;
    letter-spacing: .4px;
    margin-bottom: 2px;
}

.mains-v4-d-text {
    font-size: 11.5px;
    color: #2A4A8A;
    line-height: 1.55;
    margin: 0;
}

.mains-v4-bq-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.mains-v4-write-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1C1C1A;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.mains-v4-write-btn:hover {
    background: #333;
}

.mains-v4-write-btn svg {
    width: 13px;
    height: 13px;
}

/* Write mode */
.mains-v4-write-mode {
    flex: 1;
    display: none;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.mains-v4-write-mode.show {
    display: flex;
    min-height: 0;
    height: 100%;
    max-height: 100%;
}

.mains-v4-write-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.mains-v4-write-right {
    width: 255px;
    flex-shrink: 0;
    background: #0F1F1E;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-left: 1px solid #0a1510;
    min-height: 0;
    height: 100%;
    max-height: 100%;
}

.mains-v4-write-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.mains-v4-back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.mains-v4-back-btn:hover { color: #1C1C1A; }
.mains-v4-back-btn svg { width: 14px; height: 14px; }

.mains-v4-write-topbar-right {
    display: flex;
    align-items: center;
    gap: 7px;
}

.mains-v4-nav-btns { display: flex; gap: 5px; }

.mains-v4-nav-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 7px;
    border: 1px solid #E0DDD6;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.mains-v4-nav-btn:hover {
    background: #F9F8F5;
    border-color: #C8C3B8;
}

.mains-v4-nav-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.mains-v4-nav-btn svg { width: 13px; height: 13px; }

.mains-v4-w-badges,
.mains-v4-meta-tags .mains-v4-w-badge {
    display: inline-flex;
}

.mains-v4-w-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 11px;
}

.mains-v4-w-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
}

.mains-v4-w-badge.marks { background: #1C1C1A; color: #fff; }
.mains-v4-w-badge.words { background: #F0EDE6; color: #666; border: 1px solid #E0DDD6; }
.mains-v4-w-badge.sub { background: #EBF3FF; color: #1A5CA8; }
.mains-v4-w-badge.cat { background: #FFF3E0; color: #A05E00; }

.mains-v4-w-qtext {
    font-family: Georgia, serif;
    font-size: 15px;
    line-height: 1.8;
    color: #1C1C1A;
    margin-bottom: 12px;
}

.mains-v4-w-directive-box {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: #EEF5FF;
    border: 1px solid #C8D8F0;
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 13px;
}

.mains-v4-w-directive-box svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #2563EB;
}

.mains-v4-wd-label {
    font-size: 10px;
    font-weight: 800;
    color: #1A3C8A;
    letter-spacing: .4px;
    margin-bottom: 2px;
}

.mains-v4-wd-text {
    font-size: 11px;
    color: #2A4A8A;
    line-height: 1.5;
    margin: 0;
}

.mains-v4-textarea {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid #E0DDD6;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.65;
    resize: none;
    font-family: Georgia, serif;
    color: #1C1C1A;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}

.mains-v4-textarea:focus { border-color: #1C1C1A; }

.mains-v4-ta-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    margin-bottom: 12px;
    gap: 8px;
    flex-wrap: wrap;
}

.mains-v4-wc { font-size: 11px; color: #aaa; }
.mains-v4-wc.warn { color: #D4860F; font-weight: 600; }
.mains-v4-autosave { font-size: 11px; color: #bbb; font-style: italic; }
.mains-v4-copy-ok { font-size: 11px; color: #3B7D2E; font-weight: 600; display: none; }

.mains-v4-act-row {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.mains-v4-copy-btn,
.mains-v4-save-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.mains-v4-copy-btn {
    border: 1px solid #E0DDD6;
    background: #fff;
    color: #444;
}

.mains-v4-copy-btn:hover { background: #F9F8F5; }

.mains-v4-save-btn {
    border: 2px solid #1C1C1A;
    background: #fff;
    color: #1C1C1A;
    font-weight: 700;
    padding: 8px 14px;
}

.mains-v4-save-btn:hover { background: #F9F8F5; }

.mains-v4-eval-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: #2563EB;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    margin-left: auto;
    font-family: inherit;
}

.mains-v4-eval-btn:hover { background: #1d4ed8; }
.mains-v4-eval-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.mains-v4-eval-btn svg,
.mains-v4-copy-btn svg,
.mains-v4-save-btn svg {
    width: 13px;
    height: 13px;
}

.mains-v4-eval-prompt {
    display: none;
    background: #FFF8E8;
    border: 1px solid #F0D070;
    border-radius: 9px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.mains-v4-eval-prompt.show { display: block; }

.mains-v4-eval-prompt-head {
    font-size: 11px;
    font-weight: 800;
    color: #7A5000;
    margin-bottom: 4px;
    letter-spacing: .3px;
}

.mains-v4-eval-prompt p {
    font-size: 12px;
    color: #5A4000;
    line-height: 1.55;
    margin: 0 0 9px;
}

.mains-v4-eval-prompt button {
    background: #1E8A7A;
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.mains-v4-pn-row { display: flex; gap: 8px; }

.mains-v4-pn-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px;
    border-radius: 9px;
    border: 1px solid #E0DDD6;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    font-family: inherit;
}

.mains-v4-pn-btn:hover {
    background: #F9F8F5;
    border-color: #C8C3B8;
}

.mains-v4-pn-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.mains-v4-pn-btn svg { width: 14px; height: 14px; }

/* Hints panel */
.mains-v4-hints-panel { padding: 16px; }

.mains-v4-hints-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.mains-v4-hints-header svg {
    width: 15px;
    height: 15px;
    color: #F5C842;
    flex-shrink: 0;
}

.mains-v4-hints-header span {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.mains-v4-hint-item {
    margin-bottom: 14px;
    padding-left: 11px;
    border-left: 2px solid rgba(255, 255, 255, .15);
}

.mains-v4-hint-item.intro { border-left-color: rgba(245, 200, 66, .4); }
.mains-v4-hint-item.body { border-left-color: rgba(74, 200, 140, .4); }
.mains-v4-hint-item.conc { border-left-color: rgba(99, 153, 255, .4); }

.mains-v4-hint-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .4px;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.mains-v4-hint-item.intro .mains-v4-hint-label { color: #F5C842; }
.mains-v4-hint-item.body .mains-v4-hint-label { color: #4AC88C; }
.mains-v4-hint-item.conc .mains-v4-hint-label { color: #6399FF; }

.mains-v4-hint-text {
    font-size: 11px;
    color: #9BBFBB;
    line-height: 1.6;
    margin: 0;
}

.mains-v4-hint-text strong { color: #C5DED9; font-weight: 600; }

/* Feedback */
.mains-v4-feedback {
    margin-top: 14px;
    padding: 12px 14px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 9px;
    display: none;
}

.mains-v4-feedback.show { display: block; }

.mains-v4-feedback h4 {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 800;
    color: #1D4ED8;
}

.mains-v4-feedback p {
    margin: 0 0 6px;
    font-size: 12px;
    color: #374151;
    line-height: 1.55;
}

/* Empty / paywall */
.mains-v4-empty,
.mains-v4-loading {
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.mains-v4-paywall-screen {
    max-width: 420px;
    margin: 48px auto;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid #E0DDD6;
    border-radius: 14px;
    text-align: center;
}

.mains-v4-paywall-screen h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: #1C1C1A;
}

.mains-v4-paywall-screen p {
    margin: 0 0 16px;
    color: #666;
    font-size: 13px;
    line-height: 1.55;
}

.mains-v4-paywall-screen button {
    background: #1E8A7A;
    color: #fff;
    border: 0;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

/* Modals (quota confirm) */
.mains-v4-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.mains-v4-modal.open { display: flex; }

.mains-v4-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .62);
}

.mains-v4-quota-card {
    position: relative;
    z-index: 1;
    width: min(380px, 100%);
    padding: 30px;
    background: #fff;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .25);
}

.mains-v4-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.mains-v4-modal-actions button {
    padding: 9px 12px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.mains-v4-modal-actions .secondary {
    color: #6b7280;
    background: #fff;
    border: 1px solid #d1d5db;
}

.mains-v4-modal-actions .primary {
    color: #fff;
    background: #2563EB;
    border: 1px solid #2563EB;
}

.mains-v4-mobile-overlay {
    display: none;
    position: fixed;
    inset: var(--header-total, 58px) 0 var(--nav-total, 64px);
    z-index: 3;
    background: rgba(0, 0, 0, .48);
}

.mains-v4-mobile-overlay.show { display: block; }

.mains-v4-cal-strip {
    display: flex;
    gap: 3px;
    margin-bottom: 10px;
    align-items: center;
}

.mains-v4-cal-nav {
    flex-shrink: 0;
    width: 22px;
    height: 28px;
    border: 1px solid #E0DDD6;
    border-radius: 6px;
    background: #fff;
    color: #666;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.mains-v4-cal-month-btn {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    color: #444;
    cursor: pointer;
    text-align: center;
    width: 100%;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
}

.mains-v4-cal-month-btn:hover { color: #1C1C1A; }

.mains-v4-write-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
}

.mains-v4-textarea {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
}

.mains-v4-wc.soft-warn { color: #D4860F; font-weight: 600; }

.mains-v4-eval-btn.is-disabled,
.mains-v4-eval-btn:disabled {
    background: #d1d5db !important;
    color: #6b7280 !important;
    cursor: not-allowed;
    margin-left: auto;
}

.mains-v4-copy-block {
    flex: 1;
    min-width: 200px;
}

.mains-v4-copy-hint {
    margin: 5px 0 0;
    font-size: 10px;
    color: #888;
    line-height: 1.45;
}

.mains-v4-hint-list {
    margin: 0;
    padding-left: 1rem;
}

.mains-v4-hint-list li {
    margin: 0 0 6px;
    line-height: 1.55;
}

.mains-v4-instructions {
    margin-top: 14px;
    padding: 14px 16px;
    background: #F9F8F5;
    border: 1px solid #E0DDD6;
    border-radius: 10px;
    font-size: 12px;
    color: #555;
    line-height: 1.55;
}

.mains-v4-instructions h4 {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 800;
    color: #1C1C1A;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.mains-v4-instructions h4:not(:first-child) { margin-top: 12px; }

.mains-v4-instructions ul {
    margin: 0;
    padding-left: 1.1rem;
}

.mains-v4-instructions li { margin-bottom: 4px; }

.mains-v4-instructions p { margin: 0; }

.mains-v4-cal-card {
    position: relative;
    z-index: 1;
    width: min(360px, 100%);
    padding: 16px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .25);
}

.mains-v4-cal-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mains-v4-cal-card-head button {
    border: 1px solid #E0DDD6;
    background: #fff;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.mains-v4-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.mains-v4-cal-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 4px 2px;
    border: 1px solid #E0DDD6;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}

.mains-v4-cal-cell.has-q { border-color: #C8D8F0; background: #F8FBFF; }
.mains-v4-cal-cell.active { background: #1C1C1A; border-color: #1C1C1A; color: #fff; }
.mains-v4-cal-cell.active .c { color: #ddd; }
.mains-v4-cal-cell .d { font-size: 12px; font-weight: 700; }
.mains-v4-cal-cell .c { font-size: 8px; color: #888; margin-top: 2px; text-align: center; line-height: 1.2; }
.mains-v4-cal-pad { min-height: 48px; }

.mains-v4-mobile-toolbar {
    display: none;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #E0DDD6;
    background: #fff;
}

.mains-v4-mob-date {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.mains-v4-mob-nav {
    width: 30px;
    height: 30px;
    border: 1px solid #E0DDD6;
    border-radius: 8px;
    background: #fff;
    color: #444;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.mains-v4-mob-date-label {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #1C1C1A;
    text-align: center;
    cursor: pointer;
    padding: 6px 4px;
    font-family: inherit;
}

.mains-v4-mob-filter {
    flex-shrink: 0;
    min-width: 118px;
}

.mains-v4-mob-select {
    width: 100%;
    border: 1px solid #E0DDD6;
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #444;
    background: #FAFAF8;
    font-family: inherit;
}

.mains-v4-hints-inline {
    display: none;
    margin-bottom: 12px;
}

.mains-v4-hints-inline-box {
    border: 1px solid #C8D8F0;
    border-radius: 10px;
    background: #F8FBFF;
    padding: 12px 14px;
}

.mains-v4-hints-inline-box .mains-v4-hints-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #1A3C8A;
    letter-spacing: .3px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.mains-v4-hints-inline-box .mains-v4-hints-header svg {
    width: 14px;
    height: 14px;
    color: #2563EB;
}

.mains-v4-hints-inline-box .mains-v4-hint-label {
    color: #1A5CA8;
}

.mains-v4-hints-inline-box .mains-v4-hint-text {
    color: #334155;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mains-v4-hints-panel {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (max-width: 640px) {
    body:has(.mains-v4-app) {
        overflow: hidden;
    }

    .mains-v4-app {
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }

    .mains-v4-sidebar {
        display: none !important;
    }

    .mains-v4-mobile-toolbar {
        display: flex;
    }

    .mains-v4-main {
        flex: 1;
        min-height: 0;
        height: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .mains-v4-browse {
        flex: 1;
        min-height: 0;
        padding: 12px;
    }

    .mains-v4-write-mode {
        flex: 1;
        min-height: 0;
        height: 100%;
        flex-direction: column;
    }

    .mains-v4-write-left {
        flex: 1;
        min-height: 0;
        padding: 12px;
        height: 100%;
    }

    .mains-v4-write-scroll {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .mains-v4-write-right {
        display: none !important;
    }

    .mains-v4-hints-inline {
        display: block;
    }

    .mains-v4-textarea {
        height: 180px;
        min-height: 180px;
        max-height: none;
    }

    .mains-v4-eval-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .mains-v4-upsell-mobile {
        display: block;
        margin: 14px 0 0;
    }
}
