/* Functional additions inherit UWU colors and controls. */
.ovo-actions { display:flex; gap:8px; flex-wrap:wrap; padding:10px 15px; }
.ovo-memory-controls { margin:12px 0; padding:12px; }
.ovo-memory-controls h3,#chat-mcp-settings h3 { font-size:14px; }
.ovo-memory-controls input[type=number] { width:80px; padding:6px; border:1px solid #ddd; border-radius:8px; }
#ovo-api-settings-screen .api-section-card { padding:12px; margin:12px; }
#ovo-api-settings-screen .kkt-item { display:flex; gap:10px; padding:10px 0; align-items:center; }
#ovo-api-settings-screen .kkt-item-control { flex:1; display:flex; gap:6px; min-width:0; }
#ovo-api-settings-screen input,#ovo-api-settings-screen select { width:100%; min-width:0; padding:8px; border:1px solid #ddd; border-radius:8px; }
#ovo-api-settings-screen .api-actions-row,#ovo-api-settings-screen .api-sub-preset-btns { display:flex; gap:6px; flex-wrap:wrap; }
#ovo-api-settings-screen .api-modal-backdrop { display:none; position:fixed; inset:0; background:#0005; z-index:12000; align-items:center; justify-content:center; }
#ovo-api-settings-screen .api-clean-modal { background:var(--bg-color,#fff); width:90%; max-width:420px; padding:20px; border-radius:18px; }
#mcp-screen,#mcp-sheet { --mcp-primary:var(--primary-color); --mcp-accent:var(--primary-color); --mcp-bg:var(--bg-color,#fff); }
.auto-journal-visual-panel { background:var(--bg-color,#fff); border-radius:18px; max-height:85vh; overflow:auto; padding:18px; width:90%; max-width:600px; }
.auto-journal-range-item { display:flex; gap:8px; padding:10px; border-bottom:1px solid #eee; }
.auto-journal-range-dot { width:8px;height:8px;border-radius:50%;background:#a9bdac; flex-shrink:0; }
.auto-journal-range-dot.is-failed { background:#bd7272; }

/* Original OVO automatic-journal progress UI rules. */



.auto-journal-visual-entry {
    min-width: 132px;
    max-width: 152px;
    margin: 0;
    overflow: hidden;
}


.auto-journal-visual-entry-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.auto-journal-visual-window {
    width: min(90%, 360px);
    max-width: 360px;
    max-height: calc(100% - 32px);
    padding: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


.auto-journal-visual-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    margin-bottom: 13px;
}


.auto-journal-visual-heading-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}


.auto-journal-visual-window .auto-journal-visual-header h3 {
    min-width: 0;
    margin: 0;
    color: #333;
    font-size: calc(16px * var(--app-font-scale));
    font-weight: 500;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.auto-journal-status-pill {
    flex: 0 0 auto;
    max-width: 86px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #eef2f2;
    color: #697578;
    font-size: calc(11px * var(--app-font-scale));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.auto-journal-status-pill.is-running,
.auto-journal-status-pill.is-ready {
    background: #e8f0ed;
    color: #587068;
}


.auto-journal-status-pill.is-failed {
    background: #fff0f0;
    color: #b55454;
}


.auto-journal-progress-summary {
    padding: 12px;
    border-radius: 11px;
    background: #f5f7f7;
}


.auto-journal-progress-line,
.auto-journal-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}


.auto-journal-progress-line {
    color: #3d4346;
    font-size: calc(13px * var(--app-font-scale));
}


.auto-journal-progress-value {
    flex: 0 0 auto;
    color: #687175;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}


.auto-journal-progress-track {
    height: 7px;
    margin: 10px 0 8px;
    border-radius: 999px;
    overflow: hidden;
    background: #e4e9e9;
}


.auto-journal-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #9eb6ae;
    transition: width 0.2s ease;
}


.auto-journal-progress-meta {
    color: #858d90;
    font-size: calc(11px * var(--app-font-scale));
}


.auto-journal-progress-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.auto-journal-progress-meta span:last-child {
    flex: 0 0 auto;
}


.auto-journal-visual-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-top: 10px;
}


.auto-journal-visual-actions .btn {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding-left: 8px;
    padding-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.auto-journal-range-section {
    min-height: 0;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
}


.auto-journal-range-title {
    margin-bottom: 4px;
    color: #444;
    font-size: calc(13px * var(--app-font-scale));
    font-weight: 500;
}


.auto-journal-range-list {
    min-height: 58px;
    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
}


.auto-journal-range-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f1f2;
}


.auto-journal-range-item:last-child {
    border-bottom: none;
}


.auto-journal-range-dot {
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: #9eb6ae;
}


.auto-journal-range-dot.is-pending {
    background: #c5cbcd;
}


.auto-journal-range-dot.is-failed {
    background: #cf8585;
}


.auto-journal-range-main {
    min-width: 0;
}


.auto-journal-range-name {
    color: #444;
    font-size: calc(13px * var(--app-font-scale));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.auto-journal-range-detail,
.auto-journal-range-state,
.auto-journal-range-empty {
    color: #8a9194;
    font-size: calc(11px * var(--app-font-scale));
}


.auto-journal-range-detail {
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.auto-journal-range-state {
    padding-top: 2px;
    white-space: nowrap;
}


.auto-journal-range-state.is-failed {
    color: #b55454;
}


.auto-journal-range-empty {
    padding: 20px 4px;
    text-align: center;
}


body.night-mode-active .auto-journal-visual-window .auto-journal-visual-header h3,
body.night-mode-active .auto-journal-range-title,
body.night-mode-active .auto-journal-range-name,
body.night-mode-active .auto-journal-progress-line {
    color: #e6e9ea;
}


body.night-mode-active .auto-journal-status-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #c2c9cb;
}


body.night-mode-active .auto-journal-status-pill.is-running,
body.night-mode-active .auto-journal-status-pill.is-ready {
    background: rgba(130, 175, 160, 0.18);
    color: #b4d0c7;
}


body.night-mode-active .auto-journal-status-pill.is-failed {
    background: rgba(220, 110, 110, 0.16);
    color: #f0abab;
}


body.night-mode-active .auto-journal-progress-summary {
    background: rgba(255, 255, 255, 0.055);
}


body.night-mode-active .auto-journal-progress-track {
    background: rgba(255, 255, 255, 0.10);
}


body.night-mode-active .auto-journal-progress-fill {
    background: #86a99e;
}


body.night-mode-active .auto-journal-progress-value,
body.night-mode-active .auto-journal-progress-meta,
body.night-mode-active .auto-journal-range-detail,
body.night-mode-active .auto-journal-range-state,
body.night-mode-active .auto-journal-range-empty {
    color: #a9b0b2;
}


body.night-mode-active .auto-journal-range-item {
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

    .auto-journal-visual-window {
        width: calc(100% - 20px);
        padding: 12px;
    }


    .auto-journal-visual-header {
        gap: 7px;
    }


    .auto-journal-visual-heading-wrap {
        gap: 5px;
    }


    .auto-journal-status-pill {
        max-width: 70px;
    }


    .auto-journal-progress-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }


    .auto-journal-progress-meta span:last-child {
        flex: 1 1 auto;
    }
#ovo-api-settings-screen h3 { font-size:16px; margin:6px 0 12px; }
#ovo-api-settings-screen .api-section-description,#ovo-api-settings-screen .api-section-desc,#ovo-api-settings-screen .form-hint { font-size:12px; line-height:1.6; }
#ovo-api-settings-screen button { font-size:13px; white-space:nowrap; }
#ovo-api-settings-screen .kkt-item-label { font-size:13px; flex-shrink:0; }
#ovo-api-settings-screen .kkt-item-control button { flex-shrink:0; }

#ovo-api-settings-screen .api-card-title { font-size:16px; margin:6px 0 10px; }
#ovo-api-settings-screen .api-card-desc { font-size:12px; line-height:1.6; color:var(--secondary-color,#666); }
#mcp-screen .app-header { display:grid; grid-template-columns:40px 1fr auto 40px; gap:6px; }
#mcp-screen .title-container { position:static; transform:none; grid-column:2; grid-row:1; min-width:0; }
#mcp-screen .app-header .back-btn { grid-column:1; grid-row:1; }
#mcp-screen .ovo-mcp-proxy-login { grid-column:3; grid-row:1; width:auto; padding:8px; font-size:12px; white-space:nowrap; }
#mcp-screen #mcp-add-btn { grid-column:4; grid-row:1; }

/* Memory API settings: consistent UWU rows and compact preset actions. */
#ovo-api-settings-screen .app-header { display: grid; grid-template-columns: 40px minmax(0,1fr) 40px; gap: 8px; }
#ovo-api-settings-screen .app-header .back-btn { grid-column: 1; grid-row: 1; }
#ovo-api-settings-screen .title-container { grid-column: 2; grid-row: 1; position: static; left: auto; transform: none; width: auto; min-width: 0; text-align: center; }
#ovo-api-settings-screen .content { padding: 16px 12px 24px; box-sizing: border-box; }
#ovo-api-settings-screen .api-section-card { padding: 16px; margin: 0 0 16px; }
#ovo-api-settings-screen .api-card-title { margin: 0 0 8px; font-size: calc(16px * var(--app-font-scale)); line-height: 1.4; }
#ovo-api-settings-screen .api-card-desc { margin: 0 0 12px; font-size: calc(12px * var(--app-font-scale)); line-height: 1.6; color: #85858d; }
#ovo-api-settings-screen .kkt-item { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 10px; padding: 12px 0; min-height: 0; }
#ovo-api-settings-screen .kkt-item-label { font-size: calc(13px * var(--app-font-scale)); line-height: 1.4; }
#ovo-api-settings-screen .kkt-item-control { width: 100%; min-width: 0; display: flex; gap: 8px; }
#ovo-api-settings-screen .kkt-arrow { display: none; }
#ovo-api-settings-screen input, #ovo-api-settings-screen select { min-width: 0; width: 100%; height: 42px; margin: 0; padding: 8px 10px; border: 1px solid #dfe1e5; border-radius: 9px; box-sizing: border-box; background: #f7f8fa; color: #333; font-size: calc(13px * var(--app-font-scale)); }
#ovo-api-settings-screen .kkt-item-control input, #ovo-api-settings-screen .kkt-item-control select { flex: 1 1 0; }
#ovo-api-settings-screen .btn { margin: 0; min-width: 0; height: 42px; padding: 8px 12px; border-radius: 9px; font-size: calc(13px * var(--app-font-scale)); line-height: 1.2; white-space: nowrap; box-sizing: border-box; }
#ovo-api-settings-screen .api-fetch-btn { flex: 0 0 60px; width: 60px; }
#ovo-api-settings-screen .api-actions-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
#ovo-api-settings-screen .api-actions-row > :only-child { grid-column: 1 / -1; }
#ovo-api-settings-screen .api-field-tip { padding: 10px 0 0 !important; font-size: calc(12px * var(--app-font-scale)); line-height: 1.5; color: #85858d; overflow-wrap: anywhere; }
#ovo-api-settings-screen .api-sub-presets-strip { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #eceef1; }
#ovo-api-settings-screen .api-sub-presets-label { margin: 0; font-size: calc(13px * var(--app-font-scale)); font-weight: 500; }
#ovo-api-settings-screen .api-preset-selection { display: grid; grid-template-columns: minmax(0,1fr) 64px; gap: 8px; align-items: center; }
#ovo-api-settings-screen .api-sub-preset-btns { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
#ovo-api-settings-screen .api-sub-preset-btns .btn { width: 100%; height: 38px; padding: 6px 4px; }
#ovo-api-settings-screen .api-sub-preset-btns .btn-neutral { background: #eef0f3; color: #555; }
#ovo-api-settings-screen .api-sub-preset-btns .btn-secondary { background: var(--accent-color,#e8eef0); color: #444; }
#ovo-api-settings-screen .api-clean-modal { max-height: 80vh; overflow-y: auto; box-sizing: border-box; }
#ovo-api-settings-screen .api-modal-scroll-list { max-height: 50vh; overflow-y: auto; }
#ovo-api-settings-screen .api-modal-footer { margin-top: 14px; }
body.night-mode-active #ovo-api-settings-screen .api-section-card, body.night-mode-active #ovo-api-settings-screen .kkt-item, body.night-mode-active #ovo-api-settings-screen .api-clean-modal { background: #202329; }
body.night-mode-active #ovo-api-settings-screen input, body.night-mode-active #ovo-api-settings-screen select { background: #2a2e35; border-color: #414650; color: #eee; }
body.night-mode-active #ovo-api-settings-screen .api-sub-preset-btns .btn-neutral { background: #333841; color: #ddd; }
body.night-mode-active #ovo-api-settings-screen .api-sub-preset-btns .btn-secondary { background: #354047; color: #ddd; }
body.night-mode-active #ovo-api-settings-screen .kkt-item, body.night-mode-active #ovo-api-settings-screen .api-sub-presets-strip { border-color: #353943; }
body.night-mode-active #ovo-api-settings-screen .kkt-item-label, body.night-mode-active #ovo-api-settings-screen .api-sub-presets-label, body.night-mode-active #ovo-api-settings-screen .api-card-title { color: #eee; }
@media (max-width: 360px) {
 #ovo-api-settings-screen .api-section-card { padding: 12px; }
 #ovo-api-settings-screen .kkt-item { grid-template-columns: 72px minmax(0,1fr); gap: 8px; }
 #ovo-api-settings-screen .api-fetch-btn { flex-basis: 52px; width: 52px; padding: 8px 6px; }
}
