/* Memory module — hub, index, session/outcome detail polish */

.memory-hub-card {
    padding: 1.25rem 1.35rem;
    height: 100%;
    min-height: 12rem;
}

.memory-hub-card .mud-list-item {
    padding-left: 0;
    padding-right: 0;
}

.memory-index-table-card {
    padding: 0.25rem 0.5rem 0.5rem;
    overflow: hidden;
}

.memory-index-table .mud-table-root {
    background: transparent;
}

.memory-due--overdue {
    color: var(--mud-palette-error);
    font-weight: 600;
}

.memory-session-detail-page .memory-session-summary,
.memory-outcome-detail-page .memory-outcome-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--nx-border-default, var(--mud-palette-lines-default));
    border-radius: var(--nx-radius-medium, var(--nucleus-surface-radius, 8px));
    background: var(--nx-surface-subtle, color-mix(in srgb, var(--mud-palette-primary) 3%, var(--mud-palette-surface)));
    box-shadow: var(--nx-shadow-card, none);
}

.memory-session-summary__stat,
.memory-outcome-summary__stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.memory-session-summary__stat strong,
.memory-outcome-summary__stat strong {
    color: var(--mud-palette-text-primary);
    font-weight: 600;
}

.memory-session-detail-tab,
.memory-outcome-detail-tab {
    padding: 0.25rem 0 1rem;
    min-height: 12rem;
}

.memory-empty-state {
    padding: 1.5rem 0.5rem;
    text-align: left;
}

.memory-evidence-card {
    padding: 0.875rem 1rem;
    border: 1px solid var(--nx-border-default, var(--mud-palette-lines-default));
    border-radius: var(--nx-radius-medium, var(--nucleus-surface-radius, 8px));
    margin-bottom: 0.75rem;
    background: var(--nx-surface-card, var(--mud-palette-surface));
    box-shadow: var(--nx-shadow-card, none);
}

.memory-context-entities-panel__empty {
    padding: 0.75rem 0;
}

.memory-context-entities-panel__list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.memory-context-entities-panel__row {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.15rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.memory-context-entities-panel__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0.05rem;
}

.memory-context-entities-panel__link {
    display: inline;
    align-self: flex-start;
    max-width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    padding: 0;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mud-palette-primary);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.memory-context-entities-panel__link:hover:not(:disabled) {
    text-decoration: underline;
}

.memory-context-entities-panel__link:disabled {
    color: var(--mud-palette-text-primary);
    cursor: default;
    opacity: 0.85;
}

.memory-context-entities-panel__module {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.memory-context-entities-panel__primary {
    color: var(--mud-palette-primary);
    font-weight: 500;
}

.memory-context-entities-panel__remove {
    opacity: 0.45;
    flex-shrink: 0;
    margin-top: -0.15rem;
}

.memory-context-entities-panel__row:hover .memory-context-entities-panel__remove {
    opacity: 1;
}

/* Entity Memory panel — Context vs Impact */
.entity-memory-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.entity-memory-panel__empty {
    padding: 1rem 0.25rem;
}

/* Expandable Memory outcomes (session + entity hosts) */
.memory-outcome-expand__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.memory-outcome-expand__header-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.memory-outcome-expand__ticket-chip {
    max-width: 10rem;
}

.memory-outcome-expand__empty {
    padding: 1rem 0.25rem;
}

.memory-outcome-expand__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.memory-outcome-expand__card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 6px);
    background: var(--mud-palette-surface);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.memory-outcome-expand__card--open {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 45%, var(--mud-palette-lines-default));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

.memory-outcome-expand__summary {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: inherit;
}

.memory-outcome-expand__summary:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 3%, var(--mud-palette-surface));
}

.memory-outcome-expand__summary-main {
    flex: 1;
    min-width: 0;
}

.memory-outcome-expand__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.memory-outcome-expand__title {
    margin: 0;
    line-height: 1.35;
}

.memory-outcome-expand__meta {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

.memory-outcome-expand__chevron {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--mud-palette-text-secondary);
    transition: transform 0.15s ease;
}

.memory-outcome-expand__card--open .memory-outcome-expand__chevron {
    color: var(--mud-palette-primary);
}

.memory-outcome-expand__body {
    border-top: 1px solid var(--mud-palette-lines-default);
    padding: 0.85rem 0.9rem 1rem;
    background: color-mix(in srgb, var(--mud-palette-background) 55%, var(--mud-palette-surface));
}

.memory-outcome-expand__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.35rem 0 0.65rem;
    margin-bottom: 0.5rem;
    background: color-mix(in srgb, var(--mud-palette-background) 55%, var(--mud-palette-surface));
}

.memory-outcome-expand__section {
    margin-top: 0.85rem;
}

.memory-outcome-expand__section:first-of-type {
    margin-top: 0;
}

.memory-outcome-expand__section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 0.4rem;
}

.memory-outcome-expand__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.memory-evidence-card--compact {
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.35rem;
}

.memory-outcome-expand__loading {
    padding: 1rem 0;
}

/* Related sessions / timeline rows on entity Memory */
.entity-memory-panel__row {
    display: flex;
    width: 100%;
    text-align: left;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 6px);
    background: transparent;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
    color: inherit;
    gap: 0.5rem;
    align-items: center;
}

.entity-memory-panel__row:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 3%, var(--mud-palette-surface));
}

.entity-memory-panel__row-main {
    flex: 1;
    min-width: 0;
}

.entity-memory-panel__row-title {
    margin: 0.15rem 0;
}

.entity-memory-panel__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.entity-memory-panel__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

/* Hub layout — sessions left (~2/3), open work right rail (~1/3) */
.memory-hub {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    height: 100%;
}

.memory-hub--split {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1rem 1.25rem;
    align-items: stretch;
    min-height: 0;
    height: 100%;
}

.memory-hub__main {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding-right: 0.25rem;
}

.memory-hub__rail {
    min-width: 0;
    min-height: 0;
    border-left: 1px solid var(--mud-palette-divider);
    padding-left: 1rem;
    overflow: auto;
}

.memory-hub__rail-sticky {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.memory-hub__section-label {
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}

@media (max-width: 960px) {
    .memory-hub--split {
        grid-template-columns: 1fr;
        height: auto;
    }

    .memory-hub__rail {
        border-left: none;
        border-top: 1px solid var(--mud-palette-divider);
        padding-left: 0;
        padding-top: 0.75rem;
        order: -1; /* Open work above sessions on small screens */
    }
}

.memory-meeting-prep__body {
    max-height: 28rem;
    overflow: auto;
}

.memory-open-work__header {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.memory-open-work__header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.memory-open-work__heading {
    color: var(--mud-palette-text-primary);
    font-weight: 600;
    line-height: 1.3;
}

.memory-open-work__subtitle {
    display: block;
    margin-top: 0.1rem;
    line-height: 1.35;
}

.memory-open-work__count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.memory-open-work__spinner {
    width: 1rem !important;
    height: 1rem !important;
    margin-top: 0.2rem;
}

.memory-open-work__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    line-height: 1.3;
}

.memory-open-work__summary-overdue {
    color: var(--mud-palette-error);
    font-weight: 600;
}

.memory-open-work__filters {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.15rem;
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--nucleus-control-radius, 5px);
    background: var(--mud-palette-background-grey);
}

.memory-open-work__filter {
    min-height: 1.75rem;
    padding: 0.2rem 0.65rem;
    border: 0;
    border-radius: calc(var(--nucleus-control-radius, 5px) - 1px);
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
}

.memory-open-work__filter:hover {
    color: var(--mud-palette-text-primary);
}

.memory-open-work__filter--active {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-primary);
    box-shadow: var(--nx-shadow-subtle, 0 1px 2px rgb(0 0 0 / 8%));
    font-weight: 600;
}

.memory-open-work__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.memory-open-work__group-header {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.memory-open-work__group-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--mud-palette-text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.memory-open-work__group-count {
    flex: 0 0 auto;
    color: var(--mud-palette-text-secondary);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}

.memory-open-work__row + .memory-open-work__row {
    border-top: 1px solid var(--mud-palette-divider);
}

.memory-open-work__row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.6rem 0.15rem;
}

.memory-open-work__row--busy {
    opacity: 0.6;
    pointer-events: none;
}

.memory-open-work__complete {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

.memory-open-work__complete:hover,
.memory-open-work__complete:focus-visible {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-primary);
    outline: none;
}

.memory-open-work__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.memory-open-work__main {
    display: block;
    width: 100%;
    min-width: 0;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.memory-open-work__main:hover .memory-open-work__title {
    color: var(--mud-palette-primary);
}

.memory-open-work__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
}

.memory-open-work__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin-top: 0.3rem;
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    line-height: 1.3;
    text-align: left;
}

.memory-open-work__meta span + span::before {
    content: "·";
    margin-right: 0.5rem;
    color: var(--mud-palette-text-disabled);
}

.memory-open-work__overdue {
    color: var(--mud-palette-error);
    font-weight: 600;
}

.memory-open-work__ticket {
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--nucleus-control-radius, 5px);
    color: var(--mud-palette-primary);
    font-size: 0.6875rem;
    line-height: 1.25;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.memory-open-work__ticket:hover {
    border-color: var(--mud-palette-primary);
    text-decoration: none;
}

.memory-open-work__show-all {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.55rem;
    padding: 0.35rem 0;
    border: 0;
    background: transparent;
    color: var(--mud-palette-primary);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
}

.memory-open-work__empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    color: var(--mud-palette-text-secondary);
}

.memory-feed__item--target .memory-feed__card {
    outline: 2px solid color-mix(in srgb, var(--mud-palette-primary) 45%, transparent);
    outline-offset: 1px;
}

/* Session / Manual outcome feed (global + entity) */
.memory-feed-page {
    padding-bottom: 2rem;
}

.memory-feed__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.memory-feed__title {
    font-weight: 700;
}

.memory-feed__timeline {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.memory-feed__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem 0.75rem;
    align-items: stretch;
}

@media (max-width: 700px) {
    .memory-feed__item {
        grid-template-columns: 1fr;
    }

    .memory-feed__rail-line {
        display: none;
    }
}

.memory-feed__rail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.85rem;
}

.memory-feed__rail-marker {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.memory-feed__date {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    text-align: left;
    white-space: nowrap;
    line-height: 1.2;
}

.memory-feed__rail-line {
    position: absolute;
    top: 2.4rem;
    bottom: -1.25rem;
    left: calc(0.75rem + 0.875rem - 1px);
    width: 0;
    border-left: 2px dotted var(--mud-palette-lines-default);
}

.memory-feed__dot {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-primary);
}

.memory-feed__dot--manual {
    color: var(--mud-palette-warning);
}

.memory-feed__card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 8px);
    background: var(--mud-palette-surface);
    padding: 1rem 1.1rem 0.85rem;
}

.memory-feed__card--open {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 35%, var(--mud-palette-lines-default));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

.memory-feed__card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.memory-feed__card-heading-btn {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: inherit;
    padding: 0;
}

.memory-feed__card-heading {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.memory-feed__card-title,
.memory-feed__card-subtitle,
.memory-feed__card-heading .mud-typography {
    text-align: left !important;
    width: 100%;
}

.memory-feed__card-title {
    font-weight: 700;
    line-height: 1.3;
}

.memory-feed__participants {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.memory-feed__card-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-top: -0.15rem;
}

.memory-feed__card-pub {
    white-space: nowrap;
}

.memory-feed__card-chevron {
    color: var(--mud-palette-text-secondary);
}

/* In-feed session mini-workspace (replaces standalone session detail) */
.memory-session-workspace {
    margin-top: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.memory-session-workspace__loading {
    padding: 0.75rem 0;
}

.memory-session-workspace__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 8px);
    background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
}

.memory-session-workspace__identity {
    flex: 1;
    min-width: 12rem;
}

.memory-session-workspace__badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.memory-session-workspace__type {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.memory-session-workspace__purpose {
    margin: 0 0 0.35rem;
    color: var(--mud-palette-text-primary);
}

.memory-session-workspace__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.memory-session-workspace__actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.memory-session-workspace__tickets {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.15rem 0 0.35rem;
}

.memory-session-workspace__ticket-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.memory-session-workspace__ticket-count {
    opacity: 0.75;
    margin-left: 0.15rem;
}

.memory-session-workspace__section {
    padding-top: 0.15rem;
    border-top: 1px solid var(--mud-palette-lines-default);
    scroll-margin-top: 1rem;
}

.memory-session-workspace__section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.memory-session-workspace__section--focus {
    border-radius: var(--nucleus-surface-radius, 6px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mud-palette-primary) 28%, transparent);
    padding: 0.65rem 0.75rem;
    margin-left: -0.35rem;
    margin-right: -0.35rem;
}

.memory-session-workspace__section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.memory-session-workspace__section-label {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.memory-session-workspace__section-action {
    margin-left: auto;
}

.memory-session-workspace__notes {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.memory-session-workspace__note-body {
    font-size: 0.875rem;
    line-height: 1.45;
}

.memory-session-workspace__note-body .gp-doc-theme {
    font-size: inherit;
}

.memory-session-workspace__note-body--clamp {
    max-height: 18rem;
    overflow: hidden;
    position: relative;
}

.memory-session-workspace__note-body--clamp::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.5rem;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--mud-palette-surface));
}

.memory-session-workspace__note-block {
    white-space: pre-wrap;
    margin-bottom: 0.5rem;
}

.memory-session-workspace__people,
.memory-session-workspace__topics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.memory-session-workspace__person,
.memory-session-workspace__topic {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 6px);
    background: var(--mud-palette-surface);
}

.memory-session-workspace__person-main,
.memory-session-workspace__topic-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.memory-session-workspace__person-name,
.memory-session-workspace__topic-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.memory-session-workspace__person-meta,
.memory-session-workspace__topic-summary {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.memory-session-workspace__topic-actions {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.memory-context-entities-panel--compact .memory-context-entities-panel__empty {
    padding: 0.25rem 0;
}

.memory-context-entities-panel--compact .memory-context-entities-panel__list {
    gap: 0.1rem;
}

.memory-session-workspace__section-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
}

.memory-session-workspace__note-doc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

/* AI review dialog */
.memory-ai-review__title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.memory-ai-review__processing {
    min-height: 16rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
}

.memory-ai-review__split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.2fr);
    gap: 1rem;
    min-height: 28rem;
    max-height: min(70vh, 40rem);
}

.memory-ai-review__left,
.memory-ai-review__right {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 8px);
    padding: 0.75rem 0.85rem;
    background: var(--mud-palette-surface);
}

.memory-ai-review__tab-panel {
    padding-top: 0.25rem;
}

.memory-edit-notes-dialog .markdown-block-editor-container,
.memory-ai-review__tab-panel .markdown-block-editor-container {
    width: 100%;
}

.memory-ai-review__outcomes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.memory-ai-review__outcomes {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.memory-ai-review__outcome {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 6px);
    padding: 0.65rem 0.75rem;
    background: color-mix(in srgb, var(--mud-palette-background) 55%, var(--mud-palette-surface));
}

.memory-ai-review__outcome--excluded {
    opacity: 0.55;
}

.memory-ai-review__outcome-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.memory-ai-review__type-select {
    min-width: 9rem;
    flex: 1;
}

.memory-ai-review__outcome-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.memory-raw-source-panel {
    max-height: 60vh;
    overflow: auto;
}

@media (max-width: 900px) {
    .memory-ai-review__split {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .memory-ai-review__outcome-meta {
        grid-template-columns: 1fr;
    }
}

.memory-feed__type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.85rem;
}

.memory-feed__type-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--mud-palette-lines-default);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--mud-palette-background);
}

.memory-feed__type-chip-note {
    font-weight: 500;
    font-size: 0.6875rem;
    color: var(--mud-palette-error);
}

.memory-feed__type-chip--decision {
    color: var(--nx-semantic-success);
    border-color: color-mix(in srgb, var(--nx-semantic-success) 35%, var(--mud-palette-lines-default));
}

.memory-feed__type-chip--action {
    color: var(--nx-icon-primary-fg);
    border-color: color-mix(in srgb, var(--nx-brand-navy-600) 30%, var(--mud-palette-lines-default));
}

.memory-feed__type-chip--commitment {
    color: var(--nx-icon-secondary-fg);
    border-color: color-mix(in srgb, var(--nx-brand-navy-500) 35%, var(--mud-palette-lines-default));
}

.memory-feed__type-chip--question {
    color: var(--nx-text-link);
    border-color: color-mix(in srgb, var(--nx-brand-navy-600) 35%, var(--mud-palette-lines-default));
}

.memory-feed__type-chip--recommendation {
    color: var(--nx-semantic-warning);
    border-color: color-mix(in srgb, var(--nx-semantic-warning) 40%, var(--mud-palette-lines-default));
}

/* Nested outcome cards inside session / Manual entry */
.memory-feed__outcomes {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.memory-feed__outcome-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 8px);
    background: var(--mud-palette-surface);
    overflow: hidden;
}

.memory-feed__outcome-card--open {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 28%, var(--mud-palette-lines-default));
}

.memory-feed__outcome-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: inherit;
}

.memory-feed__outcome-summary:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 3%, var(--mud-palette-surface));
}

.memory-feed__outcome-icon-wrap {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--nx-brand-navy-800, var(--mud-palette-primary));
}

.memory-feed__outcome-icon-wrap--decision {
    background: var(--nx-brand-navy-700, var(--mud-palette-primary));
}

.memory-feed__outcome-icon-wrap--action {
    background: var(--nx-brand-navy-600, #2D628F);
}

.memory-feed__outcome-icon-wrap--commitment {
    background: var(--nx-brand-navy-800, #133A66);
}

.memory-feed__outcome-icon-wrap--question {
    background: var(--nx-brand-navy-500, #477CA5);
}

.memory-feed__outcome-icon-wrap--recommendation {
    background: var(--mud-palette-warning);
}

.memory-feed__outcome-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: left;
}

.memory-feed__outcome-type {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

.memory-feed__outcome-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.memory-feed__outcome-aside {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.memory-feed__status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--mud-palette-lines-default);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-background);
    white-space: nowrap;
}

.memory-feed__status-pill--overdue {
    border-color: color-mix(in srgb, var(--mud-palette-error) 45%, var(--mud-palette-lines-default));
    color: var(--mud-palette-error);
}

.memory-feed__status-pill--muted {
    color: var(--mud-palette-text-secondary);
    font-weight: 400;
}

.memory-feed__outcome-meta {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.memory-feed__outcome-chevron {
    color: var(--mud-palette-text-secondary);
}

.memory-feed__outcome-body {
    border-top: 1px solid var(--mud-palette-lines-default);
    padding: 0.85rem 0.9rem 1rem;
    background: color-mix(in srgb, var(--mud-palette-background) 55%, var(--mud-palette-surface));
}

.memory-feed__ticket-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-info) 45%, var(--mud-palette-lines-default));
    color: var(--mud-palette-info);
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memory-feed__ticket-chip:hover {
    background: color-mix(in srgb, var(--mud-palette-info) 12%, transparent);
}

.memory-action-outcomes__title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.memory-action-outcomes__loading {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.memory-action-outcomes__panel {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 8px);
    padding: 0.85rem 1rem 1rem;
    min-height: 100%;
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, var(--mud-palette-background));
}

.memory-action-outcomes__list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: min(52vh, 28rem);
    overflow: auto;
}

.memory-action-outcomes__row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}

.memory-action-outcomes__row:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, transparent);
}

.memory-action-outcomes__row--selected {
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
}

.memory-action-outcomes__row--linked {
    opacity: 0.72;
    cursor: default;
}

.memory-action-outcomes__row-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.memory-action-outcomes__row-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.memory-action-outcomes__row-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.memory-action-outcomes__ticket-link {
    font-weight: 600;
}

@media (max-width: 700px) {
    .memory-feed__outcome-summary {
        flex-wrap: wrap;
    }

    .memory-feed__outcome-aside {
        width: 100%;
        padding-left: 2.6rem;
        justify-content: flex-start;
    }
}
