/* Agenda layout and context composer. */
:root {
    --agenda-accent: var(--accent-color, #f59e0b);
    /* Match the full-page canvas used by Chat across app views. */
    --agenda-header-surface: var(--bg-dark, #2a2927);
    --agenda-body-surface: var(--bg-dark, #2a2927);
    --agenda-surface: #373532;
    --agenda-surface-strong: #312f2d;
    --agenda-agent-surface: #413e3a;
    --agenda-agent-surface-hover: #47443f;
    --agenda-line: rgba(226, 220, 210, 0.18);
    --agenda-soft-line: rgba(226, 220, 210, 0.11);
    --agenda-content-gutter: clamp(24px, 4vw, 58px);
    --agenda-content-max: 1450px;
    --agenda-context-width: 292px;
    --agenda-panel-gap: 16px;
    --agenda-panel-padding: clamp(16px, 2vw, 24px);
}

/* Resolve this alias on body as well as :root. The theme writes the selected
   accent on body, and resolving there prevents the root fallback from being
   frozen when the user changes color after the page has loaded. */
body {
    --agenda-accent: var(--accent-color, #f59e0b);
}

body.light-mode {
    --agenda-header-surface: var(--bg-dark, #f3f0e9);
    --agenda-body-surface: var(--bg-dark, #f3f0e9);
    --agenda-surface: #fffdf8;
    --agenda-surface-strong: #f1ede5;
    --agenda-agent-surface: #fffaf0;
    --agenda-agent-surface-hover: #fffdf8;
    --agenda-line: rgba(63, 57, 48, 0.18);
    --agenda-soft-line: rgba(63, 57, 48, 0.11);
}

.sidebar-footer .agenda-sidebar-action {
    flex: 0 0 auto;
    margin: 0 0 8px;
}

.agenda-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 54px;
    width: 100%;
    padding: 9px 12px;
    gap: 11px;
    border: 0 !important;
    border-radius: 11px !important;
    background: transparent !important;
    color: var(--codex-text-muted, var(--text-secondary, #a7a7a7)) !important;
    text-align: left;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.agenda-btn:hover,
.agenda-btn:focus-visible {
    border: 0 !important;
    background: rgba(160, 160, 160, 0.10) !important;
    color: var(--codex-text, var(--text-primary, #d0d0d0)) !important;
    box-shadow: none !important;
    transform: none;
}

.agenda-btn.active,
.agenda-btn.active:hover,
.agenda-btn.active:focus-visible {
    background: rgba(160, 160, 160, 0.14) !important;
    color: var(--codex-text, var(--text-primary, #d0d0d0)) !important;
}

body.light-mode .agenda-btn:hover,
body.light-mode .agenda-btn:focus-visible {
    background: rgba(100, 100, 100, 0.10) !important;
}

.agenda-btn.active .agenda-btn-icon,
.agenda-btn:hover .agenda-btn-icon,
.agenda-btn:focus-visible .agenda-btn-icon {
    color: currentColor !important;
}

.agenda-btn-icon {
    position: relative;
    z-index: 1;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    color: currentColor;
}

.agenda-btn-text {
    position: relative;
    z-index: 1;
    display: flex !important;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.agenda-btn-text .tool-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
}

.agenda-btn-text .tool-subtitle {
    color: var(--text-secondary, #aaa69d);
    font-size: 11px;
    line-height: 1.1;
}

.agenda-btn-pulse {
    display: none !important;
    pointer-events: none;
}

.agenda-btn:hover .agenda-btn-pulse,
.agenda-btn:focus-visible .agenda-btn-pulse,
.agenda-btn.active .agenda-btn-pulse {
    display: none !important;
}

body.sidebar-collapsed .sidebar-footer .agenda-sidebar-action {
    display: flex !important;
    justify-content: center;
    margin-bottom: 6px;
}

body.sidebar-collapsed .sidebar-footer .agenda-btn {
    width: 44px !important;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 13px !important;
}

body.sidebar-collapsed .sidebar-footer .agenda-btn-text,
body.sidebar-collapsed .sidebar-footer .agenda-btn-pulse {
    display: none !important;
}

body.sidebar-collapsed .sidebar-footer .agenda-btn-icon {
    margin: 0;
}

.agenda-view {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0;
    background: var(--agenda-body-surface);
}

.agenda-page-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 0;
    margin: 0 calc(var(--agenda-content-gutter) * -1) 24px;
    padding: clamp(20px, 2.5vw, 28px) clamp(24px, 3.5vw, 48px) clamp(14px, 1.8vw, 20px);
    border-bottom: 1px solid var(--logicum-border, var(--agenda-soft-line));
    border-radius: 0;
    background: var(--agenda-header-surface);
}

.agenda-heading {
    min-width: 0;
}

.agenda-eyebrow,
.agenda-panel-kicker {
    display: block;
    color: var(--agenda-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    line-height: 1.2;
    text-transform: uppercase;
}

/* Match the compact title stack used by Chats and Library. */
.agenda-eyebrow {
    display: none;
}

.agenda-heading h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--text-primary, #f5f4ef);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 34px;
    font-size: clamp(28px, 2.8vw, 34px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.agenda-title-mark {
    display: inline-flex;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    color: var(--agenda-accent);
}

.agenda-title-mark svg,
.agenda-agent-orb svg,
.agenda-dropzone-icon svg,
.agenda-agent-send svg {
    width: 100%;
    height: 100%;
}

.agenda-heading p {
    margin: 4px 0 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 14px;
    line-height: 1.4;
}

.agenda-view-scroll {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    padding: 0 var(--agenda-content-gutter) 176px;
    background: var(--agenda-body-surface);
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--agenda-accent) 35%, transparent) transparent;
}

.agenda-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, var(--agenda-context-width));
    align-items: start;
    gap: var(--agenda-panel-gap);
    max-width: var(--agenda-content-max);
    margin: 0 auto;
}

.agenda-schedule-panel,
.agenda-context-panel {
    min-width: 0;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 20px;
    background: var(--agenda-surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.11);
}

.agenda-schedule-panel {
    padding: var(--agenda-panel-padding);
}

.agenda-context-panel {
    padding: 20px;
}

.agenda-panel-header,
.agenda-agent-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.agenda-panel-header {
    margin-bottom: 18px;
}

.agenda-panel-header h2,
.agenda-agent-heading h2 {
    margin: 5px 0 0;
    color: var(--text-primary, #f5f4ef);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.agenda-timezone,
.agenda-context-count {
    flex: 0 0 auto;
    color: var(--text-secondary, #aaa69d);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.agenda-context-count {
    color: var(--agenda-accent);
    font-weight: 800;
    letter-spacing: 0.12em;
}

.agenda-calendar {
    display: grid;
    grid-template-columns: 70px repeat(7, minmax(64px, 1fr));
    overflow: hidden;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 15px;
    background: var(--agenda-surface-strong);
}

.agenda-calendar > * {
    min-width: 0;
    border-right: 1px solid var(--agenda-soft-line);
    border-bottom: 1px solid var(--agenda-soft-line);
}

.agenda-calendar > *:nth-child(8n) {
    border-right: 0;
}

.agenda-calendar > *:nth-last-child(-n + 8) {
    border-bottom: 0;
}

.agenda-calendar-corner {
    min-height: 66px;
}

.agenda-day-heading {
    display: flex;
    min-height: 66px;
    flex-direction: column;
    justify-content: center;
    padding: 8px 7px;
    color: var(--text-primary, #f5f4ef);
    text-align: center;
}

.agenda-day-heading span {
    color: var(--agenda-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.agenda-day-heading small,
.agenda-time-label small {
    display: block;
    margin-top: 3px;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
}

.agenda-time-label {
    display: flex;
    min-height: 74px;
    flex-direction: column;
    justify-content: center;
    padding: 8px 7px;
    color: var(--text-primary, #f5f4ef);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.agenda-slot {
    position: relative;
    min-height: 74px;
    background: linear-gradient(135deg, transparent 0%, color-mix(in srgb, var(--agenda-accent) 2%, transparent) 100%);
    outline: none;
    transition: background 160ms ease, box-shadow 160ms ease;
}

.agenda-slot:hover,
.agenda-slot:focus-visible {
    z-index: 1;
    background: color-mix(in srgb, var(--agenda-accent) 9%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--agenda-accent) 42%, transparent);
}

.agenda-slot-line {
    position: absolute;
    top: 50%;
    left: 12%;
    width: 76%;
    height: 1px;
    background: color-mix(in srgb, var(--agenda-accent) 12%, transparent);
    opacity: 0;
    transform: scaleX(0.55);
    transition: opacity 160ms ease, transform 160ms ease;
}

.agenda-slot:hover .agenda-slot-line,
.agenda-slot:focus-visible .agenda-slot-line {
    opacity: 1;
    transform: scaleX(1);
}

.agenda-agent-panel {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--agenda-soft-line);
}

.agenda-agent-heading {
    justify-content: flex-start;
}

.agenda-agent-orb {
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 12px;
    color: var(--agenda-accent);
    background: color-mix(in srgb, var(--agenda-accent) 12%, transparent);
}

.agenda-coming-soon {
    margin-left: auto;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--text-secondary, #aaa69d);
    background: color-mix(in srgb, var(--text-secondary, #aaa69d) 9%, transparent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.agenda-agent-send {
    display: inline-flex;
    align-self: stretch;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    margin-top: 14px;
    padding: 9px 14px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 48%, var(--agenda-soft-line));
    border-radius: 11px;
    color: var(--bg-main, #292826);
    background: var(--agenda-accent);
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.agenda-agent-send svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.agenda-agent-send:not(:disabled):hover,
.agenda-agent-send:not(:disabled):focus-visible {
    border-color: color-mix(in srgb, var(--agenda-accent) 72%, var(--agenda-soft-line));
    background: color-mix(in srgb, var(--agenda-accent) 88%, white);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--agenda-accent) 18%, transparent);
}

.agenda-agent-send:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--agenda-accent) 48%, transparent);
    outline-offset: 2px;
}

.agenda-agent-send:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.agenda-agent-status {
    min-height: 15px;
    margin: 8px 1px 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    line-height: 1.45;
}

.agenda-agent-status[data-tone="sending"] {
    color: var(--agenda-accent);
}

.agenda-agent-status[data-tone="success"] {
    color: color-mix(in srgb, #6fcf97 82%, var(--text-primary));
}

.agenda-agent-status[data-tone="error"],
.agenda-agent-status[data-tone="warning"] {
    color: color-mix(in srgb, #e7a27d 82%, var(--text-primary));
}

.agenda-dropzone {
    display: flex;
    min-height: 366px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px 22px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--agenda-accent) 11%, transparent), transparent 58%), color-mix(in srgb, var(--agenda-accent) 3%, transparent);
    color: var(--text-primary, #f5f4ef);
    text-align: center;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.agenda-dropzone:hover,
.agenda-dropzone:focus-visible {
    border-color: transparent;
    background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--agenda-accent) 16%, transparent), transparent 58%), color-mix(in srgb, var(--agenda-accent) 5%, transparent);
    transform: none;
}

.agenda-dropzone.is-dragging,
.agenda-dropzone.has-files {
    border-color: transparent;
    background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--agenda-accent) 17%, transparent), transparent 62%), color-mix(in srgb, var(--agenda-accent) 6%, transparent);
}

.agenda-dropzone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.agenda-dropzone-browse {
    margin-top: 11px;
    color: var(--agenda-accent);
    font-size: 11px;
    font-weight: 750;
}

.agenda-file-input {
    display: none;
}

.agenda-file-list {
    display: flex;
    width: 100%;
    max-height: 210px;
    flex-direction: column;
    gap: 7px;
    margin-top: 18px;
    overflow-y: auto;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--agenda-accent) 35%, transparent) transparent;
}

.agenda-file-item {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 22%, var(--agenda-soft-line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--agenda-surface-strong) 75%, transparent);
}

.agenda-file-item-icon {
    display: grid;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 6px;
    color: var(--agenda-accent);
    background: color-mix(in srgb, var(--agenda-accent) 14%, transparent);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1;
}

.agenda-file-item-copy {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
}

.agenda-file-item-name {
    overflow: hidden;
    color: var(--text-primary, #f5f4ef);
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-file-item-meta {
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
}

.agenda-file-item-remove {
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #aaa69d);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.agenda-file-item-remove:hover,
.agenda-file-item-remove:focus-visible {
    background: color-mix(in srgb, var(--text-primary) 10%, transparent);
    color: var(--text-primary, #f5f4ef);
    outline: none;
}

.agenda-dropzone-icon {
    display: inline-flex;
    width: 43px;
    height: 43px;
    margin-bottom: 16px;
    padding: 11px;
    border-radius: 14px;
    color: var(--agenda-accent);
    background: color-mix(in srgb, var(--agenda-accent) 14%, transparent);
}

.agenda-dropzone strong {
    font-size: 14px;
    font-weight: 700;
}

.agenda-dropzone p {
    max-width: 230px;
    margin: 10px 0 20px;
    color: var(--text-secondary, #aaa69d);
    font-size: 12px;
    line-height: 1.55;
}

.agenda-dropzone-types {
    padding: 6px 9px;
    border-radius: 7px;
    color: var(--text-secondary, #aaa69d);
    background: color-mix(in srgb, var(--text-secondary, #aaa69d) 8%, transparent);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.agenda-context-notes {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--agenda-soft-line);
}

.agenda-context-notes-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary, #f5f4ef);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.agenda-context-notes-icon {
    display: inline-flex;
    flex: 0 0 18px;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--agenda-accent);
}

.agenda-context-notes textarea {
    display: block;
    width: 100%;
    min-height: 108px;
    max-height: 190px;
    margin-top: 10px;
    padding: 12px 13px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 12px;
    outline: 0;
    resize: vertical;
    background: color-mix(in srgb, var(--agenda-surface-strong) 72%, transparent);
    color: var(--text-primary, #f5f4ef);
    font: inherit;
    font-size: 12px;
    line-height: 1.5;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.agenda-context-notes textarea::placeholder {
    color: var(--text-secondary, #aaa69d);
    opacity: 0.8;
}

.agenda-context-notes textarea:focus {
    border-color: color-mix(in srgb, var(--agenda-accent) 62%, var(--agenda-soft-line));
    background: color-mix(in srgb, var(--agenda-accent) 4%, var(--agenda-surface-strong));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agenda-accent) 12%, transparent);
}

.agenda-context-notes > p {
    margin: 8px 1px 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    line-height: 1.45;
}

@media (max-width: 980px) {
    .agenda-view {
        --agenda-context-width: 250px;
    }

    .agenda-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
    }

    .agenda-calendar {
        grid-template-columns: 64px repeat(7, minmax(58px, 1fr));
    }

    .agenda-day-heading small {
        display: none;
    }
}

@media (max-width: 768px) {
    #agendaView {
        --agenda-content-gutter: var(--mobile-gutter, 14px);
        --agenda-context-width: 0px;
        --agenda-panel-gap: 0px;
        --agenda-panel-padding: 14px;
        height: var(--app-height, 100dvh);
        min-height: 0;
    }

    body.sidebar-open .sidebar .agenda-sidebar-action {
        display: block !important;
    }

    body.sidebar-open .sidebar .agenda-btn {
        width: 100% !important;
        min-height: 54px;
        justify-content: flex-start !important;
    }

    body.sidebar-open .sidebar .agenda-btn-text {
        display: flex !important;
    }

    .agenda-page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        min-height: 82px;
        margin-bottom: 16px;
        padding: calc(14px + var(--mobile-safe-top, 0px)) var(--mobile-gutter, 16px) 12px;
    }

    .agenda-heading h1 {
        font-size: clamp(28px, 8vw, 32px);
    }

    .agenda-view-scroll {
        padding: 0 var(--agenda-content-gutter) calc(180px + var(--mobile-safe-bottom, 0px));
    }

    .agenda-layout {
        display: flex;
        flex-direction: column;
    }

    .agenda-schedule-panel,
    .agenda-context-panel {
        width: 100%;
        border-radius: 16px;
    }

    .agenda-schedule-panel {
        padding: 14px;
    }

    .agenda-context-panel {
        padding: 16px;
    }

    .agenda-calendar {
        overflow-x: auto;
        grid-template-columns: 54px repeat(7, minmax(72px, 1fr));
    }

    .agenda-calendar > * {
        min-width: 72px;
    }

    .agenda-calendar > .agenda-calendar-corner,
    .agenda-calendar > .agenda-time-label {
        min-width: 54px;
    }

    .agenda-dropzone {
        min-height: 280px;
    }

    .agenda-context-notes textarea {
        min-height: 96px;
        max-height: 170px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .agenda-btn,
    .agenda-slot,
    .agenda-dropzone,
    .agenda-context-notes textarea {
        transition: none;
    }
}

/* Direct schedule editing: quiet controls that stay out of the way until needed. */
.agenda-schedule-toolbar {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 10px;
}

.agenda-schedule-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.agenda-toolbar-button {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 8px;
    color: var(--text-secondary, #aaa69d);
    background: color-mix(in srgb, var(--agenda-surface-strong) 82%, transparent);
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.agenda-toolbar-button:hover,
.agenda-toolbar-button[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--agenda-accent) 56%, var(--agenda-soft-line));
    color: var(--text-primary, #f5f4ef);
    background: color-mix(in srgb, var(--agenda-accent) 10%, var(--agenda-surface-strong));
}

.agenda-toolbar-button.is-primary {
    border-color: color-mix(in srgb, var(--agenda-accent) 38%, var(--agenda-soft-line));
    color: var(--agenda-accent);
}

.agenda-toolbar-button.is-danger {
    border-color: color-mix(in srgb, #e58b91 28%, var(--agenda-soft-line));
    color: #eaa2a6;
}

.agenda-toolbar-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.agenda-toolbar-plus {
    display: inline-grid;
    width: 15px;
    height: 15px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

.agenda-selection-summary {
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
}

.agenda-event-select {
    position: absolute;
    z-index: 3;
    top: 6px;
    right: 6px;
    display: none;
    width: 17px;
    height: 17px;
    place-items: center;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--event-color) 54%, white 10%);
    border-radius: 5px;
    color: transparent;
    background: color-mix(in srgb, var(--agenda-surface-strong) 78%, transparent);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    cursor: pointer;
}

.agenda-calendar.is-selection-mode .agenda-event-select {
    display: grid;
}

.agenda-event-select[aria-pressed="true"] {
    color: var(--agenda-surface-strong);
    border-color: var(--event-color);
    background: var(--event-color);
}

.agenda-event.is-selected {
    z-index: 5;
    border-color: color-mix(in srgb, var(--event-color) 88%, white);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--event-color) 25%, transparent), 0 10px 24px color-mix(in srgb, var(--event-color) 17%, transparent);
}

.agenda-editor-modal {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.agenda-editor-modal[hidden] {
    display: none !important;
}

.agenda-editor-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(12 12 11 / 66%);
    backdrop-filter: blur(6px);
}

.agenda-editor-dialog {
    position: relative;
    width: min(100%, 480px);
    overflow: hidden;
    border: 1px solid var(--agenda-line);
    border-radius: 16px;
    background: var(--agenda-surface-strong, #292a27);
    box-shadow: 0 24px 70px rgb(0 0 0 / 32%);
}

.agenda-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--agenda-soft-line);
}

.agenda-editor-header h2 {
    margin: 3px 0 0;
    color: var(--text-primary, #f5f4ef);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.025em;
}

.agenda-editor-close {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 8px;
    color: var(--text-secondary, #aaa69d);
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.agenda-editor-close:hover {
    color: var(--text-primary, #f5f4ef);
    background: color-mix(in srgb, var(--agenda-accent) 10%, transparent);
}

.agenda-editor-form {
    display: grid;
    gap: 15px;
    padding: 20px 22px 22px;
}

.agenda-field {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.agenda-field-full {
    grid-column: 1 / -1;
}

.agenda-field input,
.agenda-field select {
    width: 100%;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 8px;
    outline: none;
    color: var(--text-primary, #f5f4ef);
    background: color-mix(in srgb, var(--agenda-surface) 86%, black 14%);
    font: inherit;
    font-size: 12px;
    font-weight: 550;
    letter-spacing: 0;
    text-transform: none;
}

.agenda-field input:focus,
.agenda-field select:focus {
    border-color: color-mix(in srgb, var(--agenda-accent) 68%, var(--agenda-soft-line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agenda-accent) 12%, transparent);
}

.agenda-field input::placeholder {
    color: var(--text-secondary, #aaa69d);
    opacity: .7;
}

.agenda-editor-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 14px 12px;
}

.agenda-editor-grid .agenda-field:nth-child(3),
.agenda-editor-grid .agenda-field:nth-child(4) {
    grid-row: 2;
}

.agenda-editor-status {
    min-height: 15px;
    margin: -3px 0 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    line-height: 1.4;
}

.agenda-editor-status[data-tone="error"] {
    color: #eaa2a6;
}

.agenda-editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 3px;
}

.agenda-editor-spacer {
    flex: 1;
}

.agenda-editor-cancel,
.agenda-editor-delete,
.agenda-editor-save {
    min-height: 34px;
    padding: 0 13px;
    border-radius: 8px;
    font: inherit;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
}

.agenda-editor-cancel {
    border: 1px solid var(--agenda-soft-line);
    color: var(--text-secondary, #aaa69d);
    background: transparent;
}

.agenda-editor-delete {
    border: 1px solid color-mix(in srgb, #e58b91 34%, var(--agenda-soft-line));
    color: #eaa2a6;
    background: transparent;
}

.agenda-editor-save {
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 50%, transparent);
    color: #151714;
    background: var(--agenda-accent);
}

.agenda-editor-cancel:hover,
.agenda-editor-delete:hover {
    background: color-mix(in srgb, var(--agenda-accent) 9%, transparent);
}

.agenda-editor-save:hover {
    filter: brightness(1.08);
}

@media (max-width: 720px) {
    .agenda-schedule-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .agenda-editor-modal {
        align-items: end;
        padding: 10px;
    }

    .agenda-editor-dialog {
        max-height: calc(100vh - 20px);
        overflow: auto;
    }
}

/* Agenda v1 timeline: events are positioned by exact minutes, not by fixed
   one-hour cells. The hour rules remain visual guides only. */
.agenda-calendar {
    --agenda-calendar-height: 980px;
    display: grid;
    grid-template-columns: 66px repeat(7, minmax(92px, 1fr));
    grid-template-rows: 66px var(--agenda-calendar-height);
    overflow-x: auto;
    overflow-y: hidden;
    isolation: isolate;
}

.agenda-calendar > * {
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--agenda-soft-line);
    border-bottom: 0;
}

.agenda-calendar > *:nth-child(8n),
.agenda-calendar > *:nth-last-child(-n + 8) {
    border-right: 0;
    border-bottom: 0;
}

.agenda-calendar-corner,
.agenda-day-heading {
    grid-row: 1;
}

.agenda-calendar-corner {
    min-height: 66px;
}

.agenda-day-heading {
    min-width: 92px;
}

.agenda-time-rail {
    position: relative;
    grid-column: 1;
    grid-row: 2;
    border-top: 1px solid var(--agenda-soft-line);
}

.agenda-time-label {
    position: absolute;
    right: 10px;
    display: block;
    width: max-content;
    margin-top: -7px;
    padding: 0;
    border: 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.agenda-day-column {
    position: relative;
    grid-row: 2;
    min-width: 92px;
    height: var(--agenda-calendar-height);
    overflow: hidden;
    border-top: 1px solid var(--agenda-soft-line);
    background: linear-gradient(90deg, color-mix(in srgb, var(--agenda-accent) 2%, transparent), transparent 72%);
}

.agenda-hour-line {
    position: absolute;
    right: 0;
    left: 0;
    height: 1px;
    background: var(--agenda-soft-line);
    pointer-events: none;
}

.agenda-event {
    position: absolute;
    z-index: 2;
    display: flex;
    min-height: 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    overflow: hidden;
    padding: 9px 8px 8px 11px;
    border: 1px solid color-mix(in srgb, var(--event-color) 42%, transparent);
    border-left: 3px solid var(--event-color);
    border-radius: 9px;
    background: color-mix(in srgb, var(--event-color) 16%, var(--agenda-surface));
    color: var(--text-primary, #f5f4ef);
    box-shadow: 0 5px 14px color-mix(in srgb, var(--event-color) 8%, transparent);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.agenda-event:hover,
.agenda-event:focus-visible {
    z-index: 4;
    border-color: color-mix(in srgb, var(--event-color) 78%, transparent);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--event-color) 16%, transparent);
    outline: none;
    transform: translateY(-1px);
}

.agenda-event--school { --event-color: #67a8d9; }
.agenda-event--study { --event-color: #a78bfa; }
.agenda-event--sport { --event-color: #6fcf97; }
.agenda-event--appointment { --event-color: #e7b86f; }
.agenda-event--personal { --event-color: #e48ab0; }
.agenda-event.is-needs-review { border-style: dashed; }

.agenda-event-category {
    color: var(--event-color);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1;
    text-transform: uppercase;
}

.agenda-event-title {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-event-time,
.agenda-event-location {
    max-width: 100%;
    overflow: hidden;
    color: var(--text-secondary, #aaa69d);
    font-size: 9px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-event-location::before {
    content: '· ';
    color: var(--event-color);
}

.agenda-import-summary {
    margin: 10px 1px 0;
    padding: 9px 10px;
    border-left: 2px solid var(--agenda-accent);
    color: var(--text-secondary, #aaa69d);
    background: color-mix(in srgb, var(--agenda-accent) 7%, transparent);
    font-size: 10px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .agenda-calendar {
        --agenda-calendar-height: 900px;
        grid-template-columns: 54px repeat(7, minmax(84px, 1fr));
    }

    .agenda-day-heading,
    .agenda-day-column {
        min-width: 84px;
    }

    .agenda-time-label {
        right: 7px;
        font-size: 9px;
    }

    .agenda-event {
        padding: 7px 6px 6px 8px;
    }
}

/* Readable event cards: hierarchy first, metadata second. */
.agenda-event {
    gap: 4px;
    padding: 8px 9px 8px 12px;
    border-width: 1px;
    border-left-width: 3px;
    background: color-mix(in srgb, var(--event-color) 20%, var(--agenda-surface-strong));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--event-color) 12%, transparent);
}

.agenda-event.is-compact {
    gap: 2px;
    padding: 6px 7px 6px 10px;
}

.agenda-event.is-standard {
    padding-top: 7px;
    padding-bottom: 7px;
}

.agenda-event.is-extended {
    padding-top: 9px;
    padding-bottom: 9px;
}

.agenda-event-category {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    overflow: hidden;
    color: color-mix(in srgb, var(--event-color) 92%, white);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .11em;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-event-title {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    color: var(--text-primary, #f5f4ef);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -.015em;
    line-height: 1.18;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
}

.agenda-event.is-compact .agenda-event-title {
    font-size: 11px;
    -webkit-line-clamp: 1;
}

.agenda-event-time,
.agenda-event-location {
    max-width: 100%;
    color: color-mix(in srgb, var(--text-primary, #f5f4ef) 68%, var(--event-color));
    font-size: 9px;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-event.is-compact .agenda-event-time {
    font-size: 8px;
}

.agenda-event.is-needs-review {
    border-style: solid;
    opacity: .96;
}

.agenda-event.is-recurring::after {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #efc36d;
    box-shadow: 0 0 0 3px color-mix(in srgb, #efc36d 16%, transparent);
    content: '';
}

/* A restrained calibration animation for the import step. */
.agenda-dropzone.is-processing {
    cursor: progress;
    border-color: color-mix(in srgb, var(--agenda-accent) 72%, var(--agenda-line));
    background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--agenda-accent) 13%, transparent), transparent 62%), color-mix(in srgb, var(--agenda-accent) 5%, transparent);
}

.agenda-dropzone.is-processing:hover {
    transform: none;
}

.agenda-dropzone.is-processing > .agenda-dropzone-icon,
.agenda-dropzone.is-processing > .agenda-dropzone-prompt {
    opacity: .35;
}

.agenda-analysis-progress {
    display: grid;
    width: min(100%, 244px);
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 11px 12px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 26%, var(--agenda-soft-line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--agenda-surface-strong) 88%, transparent);
    text-align: left;
}

.agenda-analysis-progress[hidden] {
    display: none !important;
}

.agenda-analysis-mark {
    position: relative;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 58%, transparent);
    border-radius: 50%;
    color: var(--agenda-accent);
}

.agenda-analysis-mark::before,
.agenda-analysis-mark::after {
    position: absolute;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 46%, transparent);
    border-radius: 50%;
    content: '';
}

.agenda-analysis-mark::before {
    inset: 5px;
    border-right-color: transparent;
    animation: agenda-calibration-spin 2.2s linear infinite;
}

.agenda-analysis-mark::after {
    inset: 10px;
    border-left-color: transparent;
    animation: agenda-calibration-spin-reverse 1.4s linear infinite;
}

.agenda-analysis-mark i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--agenda-accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--agenda-accent) 70%, transparent);
}

.agenda-analysis-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.agenda-analysis-copy strong {
    overflow: hidden;
    color: var(--text-primary, #f5f4ef);
    font-size: 10px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-analysis-copy small {
    color: var(--text-secondary, #aaa69d);
    font-size: 9px;
    line-height: 1.25;
}

.agenda-analysis-rule {
    position: relative;
    display: block;
    grid-column: 1 / -1;
    width: 100%;
    height: 2px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--agenda-accent) 13%, transparent);
}

.agenda-analysis-rule i {
    position: absolute;
    top: 0;
    left: -28%;
    width: 28%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--agenda-accent), transparent);
    animation: agenda-calibration-scan 1.6s ease-in-out infinite;
}

@keyframes agenda-calibration-spin {
    to { transform: rotate(360deg); }
}

@keyframes agenda-calibration-spin-reverse {
    to { transform: rotate(-360deg); }
}

@keyframes agenda-calibration-scan {
    0% { transform: translateX(0); }
    100% { transform: translateX(460%); }
}

@media (prefers-reduced-motion: reduce) {
    .agenda-analysis-mark::before,
    .agenda-analysis-mark::after,
    .agenda-analysis-rule i {
        animation: none;
    }
}

/* Final Agenda polish: one accent system, readable event hierarchy, and a
   deliberate editor surface for the active Agenda Agent. */
.agenda-event--school { --event-color: var(--agenda-accent); }
.agenda-event--study { --event-color: color-mix(in srgb, var(--agenda-accent) 78%, white); }
.agenda-event--sport { --event-color: color-mix(in srgb, var(--agenda-accent) 70%, #b8e3c5); }
.agenda-event--appointment { --event-color: color-mix(in srgb, var(--agenda-accent) 68%, #f0d19d); }
.agenda-event--personal { --event-color: color-mix(in srgb, var(--agenda-accent) 64%, #eab6c9); }

.agenda-event {
    background: linear-gradient(135deg, color-mix(in srgb, var(--event-color) 25%, var(--agenda-surface-strong)) 0%, color-mix(in srgb, var(--event-color) 13%, var(--agenda-surface-strong)) 100%);
}

.agenda-event.is-compact {
    gap: 3px;
    padding: 5px 7px 5px 10px;
}

.agenda-event.is-compact .agenda-event-category {
    display: none;
}

.agenda-event.is-compact .agenda-event-title {
    font-size: 11px;
    line-height: 1.2;
}

.agenda-event.is-compact .agenda-event-time {
    font-size: 9px;
    line-height: 1.15;
}

#agendaImportSummary {
    display: none !important;
}

.agenda-dropzone {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.agenda-dropzone > * {
    position: relative;
    z-index: 1;
}

/* Personal agenda view controls. The popover stays attached to the schedule
   header so changing the visible range never competes with the calendar. */
.agenda-view-settings {
    position: relative;
    z-index: 12;
    flex: 0 0 auto;
}

.agenda-view-settings-button {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 8px;
    color: var(--text-secondary, #aaa69d);
    background: color-mix(in srgb, var(--agenda-surface-strong) 78%, transparent);
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.agenda-view-settings-button svg {
    width: 16px;
    height: 16px;
}

.agenda-view-settings-button:hover,
.agenda-view-settings-button:focus-visible,
.agenda-view-settings-button[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--agenda-accent) 52%, var(--agenda-soft-line));
    color: var(--agenda-accent);
    background: color-mix(in srgb, var(--agenda-accent) 10%, transparent);
    outline: none;
}

.agenda-view-settings-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(310px, calc(100vw - 36px));
    padding: 14px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 14px;
    background: var(--agenda-surface-strong);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.agenda-view-settings-popover[hidden] {
    display: none;
}

.agenda-view-settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--agenda-soft-line);
}

.agenda-view-settings-heading strong,
.agenda-view-settings-heading small {
    display: block;
}

.agenda-view-settings-heading strong {
    color: var(--text-primary, #f5f4ef);
    font-size: 13px;
}

.agenda-view-settings-heading small,
.agenda-weekend-toggle small {
    margin-top: 3px;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    line-height: 1.35;
}

.agenda-view-settings-close {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: var(--text-secondary, #aaa69d);
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.agenda-view-settings-close:hover,
.agenda-view-settings-close:focus-visible {
    color: var(--text-primary, #f5f4ef);
    background: color-mix(in srgb, var(--text-primary) 8%, transparent);
    outline: none;
}

.agenda-view-settings-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 13px 0;
}

.agenda-view-settings-fields label {
    display: grid;
    gap: 5px;
}

.agenda-view-settings-fields label span {
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.agenda-view-settings-field-full {
    grid-column: 1 / -1;
}

.agenda-view-settings-fields select {
    width: 100%;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 8px;
    color: var(--text-primary, #f5f4ef);
    background: color-mix(in srgb, var(--agenda-surface) 82%, transparent);
    font: inherit;
    font-size: 12px;
}

.agenda-view-settings-fields select:focus-visible {
    border-color: color-mix(in srgb, var(--agenda-accent) 58%, var(--agenda-soft-line));
    outline: 2px solid color-mix(in srgb, var(--agenda-accent) 24%, transparent);
    outline-offset: 1px;
}

.agenda-weekend-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--agenda-soft-line);
}

.agenda-weekend-toggle > span:first-child {
    display: block;
    min-width: 0;
}

.agenda-weekend-toggle strong {
    display: block;
    color: var(--text-primary, #f5f4ef);
    font-size: 11px;
    line-height: 1.25;
}

.agenda-weekend-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.agenda-settings-switch {
    display: inline-flex;
    flex: 0 0 auto;
    width: 34px;
    height: 20px;
    align-items: center;
    padding: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-secondary) 25%, transparent);
    cursor: pointer;
    transition: background-color 140ms ease;
}

.agenda-settings-switch span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary, #f5f4ef);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
    transition: transform 140ms ease;
}

.agenda-weekend-toggle input:checked + .agenda-settings-switch {
    background: var(--agenda-accent);
}

.agenda-weekend-toggle input:checked + .agenda-settings-switch span {
    transform: translateX(14px);
}

.agenda-weekend-toggle input:focus-visible + .agenda-settings-switch {
    outline: 2px solid color-mix(in srgb, var(--agenda-accent) 52%, transparent);
    outline-offset: 2px;
}

.agenda-view-settings-apply {
    width: 100%;
    min-height: 34px;
    margin-top: 3px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 48%, var(--agenda-soft-line));
    border-radius: 8px;
    color: var(--accent-text, #171713);
    background: var(--agenda-accent);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
}

.agenda-view-settings-apply:hover,
.agenda-view-settings-apply:focus-visible {
    filter: brightness(1.08);
    outline: none;
}

.agenda-calendar > .agenda-day-column:last-child {
    border-right: 0;
}

@media (max-width: 720px) {
    .agenda-view-settings-popover {
        right: -4px;
    }
}

.agenda-agent-reply {
    grid-column: 1;
    grid-row: 3;
    align-self: center;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: color-mix(in srgb, var(--agenda-accent) 74%, var(--text-primary, #f5f4ef));
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-agent-reply[data-tone="info"] {
    color: var(--text-secondary, #aaa69d);
}

.agenda-agent-reply[data-tone="sending"] {
    color: var(--agenda-accent);
}

.agenda-agent-reply[hidden] {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .agenda-dropzone::before {
        animation: none !important;
        transition: none;
    }
}

.agenda-toolbar-plus {
    display: inline;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    font-size: 17px;
    font-weight: 500;
    line-height: 1;
}

/* Agenda shares the same title rhythm as Chat. Keep the icon at title scale
   and let the selected application accent carry the identity. */
.agenda-page-header {
    box-sizing: border-box;
    background: var(--logicum-canvas, var(--agenda-header-surface));
    border-bottom-color: var(--logicum-border, var(--agenda-soft-line));
}

.agenda-heading h1 {
    min-height: 44px;
    gap: 13px;
    font-size: clamp(28px, 2.8vw, 34px);
    font-weight: 700 !important;
    line-height: 1.2;
}

.agenda-title-mark {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    color: var(--accent-color, var(--agenda-accent));
}

.agenda-title-mark svg {
    width: 42px;
    height: 42px;
    stroke-width: 1.75;
}

/* Match the 16px content geometry used by the rest of the product and keep
   the calendar's top corners visibly contained inside its panel. */
.agenda-schedule-panel,
.agenda-context-panel {
    border-radius: 16px;
}

.agenda-calendar {
    border-radius: 14px;
}

/* Calendar navigation and live time layer. These controls stay deliberately
   quiet so the schedule remains the primary object on the page. */
.agenda-panel-header-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

.agenda-week-label {
    color: var(--text-secondary, #aaa69d);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.agenda-week-navigation {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--agenda-surface-strong) 76%, transparent);
}

.agenda-week-nav-button {
    display: inline-flex;
    width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: var(--text-primary, #f5f4ef);
    background: transparent;
    cursor: pointer;
    transition: color 140ms ease, background-color 140ms ease, opacity 140ms ease;
}

.agenda-week-nav-button svg {
    width: 15px;
    height: 15px;
}

.agenda-week-nav-button:hover:not(:disabled),
.agenda-week-nav-button:focus-visible:not(:disabled) {
    color: var(--accent-text, #171713);
    background: var(--agenda-accent);
    outline: none;
}

.agenda-week-nav-button:disabled {
    color: var(--text-secondary, #aaa69d);
    cursor: not-allowed;
    opacity: .34;
}

.agenda-calendar {
    position: relative;
}

/* Explicit class selectors keep the day boundaries intact even when the
   live-time marker is appended after the seven columns. */
.agenda-calendar > .agenda-calendar-corner,
.agenda-calendar > .agenda-day-heading,
.agenda-calendar > .agenda-time-rail {
    border-right: 1px solid var(--agenda-soft-line);
}

.agenda-calendar > .agenda-day-column {
    border-right: 0;
    border-left: 1px solid var(--agenda-soft-line);
}

.agenda-day-heading {
    position: relative;
    transition: color 160ms ease, background-color 160ms ease;
}

.agenda-day-heading.is-today {
    background: color-mix(in srgb, var(--agenda-accent) 7%, transparent);
}

.agenda-day-heading.is-today::after {
    position: absolute;
    right: 12px;
    bottom: 8px;
    left: 12px;
    height: 2px;
    border-radius: 2px;
    background: var(--agenda-accent);
    content: '';
    opacity: .82;
}

.agenda-day-heading.is-today small {
    color: color-mix(in srgb, var(--agenda-accent) 70%, var(--text-secondary, #aaa69d));
}

.agenda-now-indicator {
    position: absolute;
    z-index: 5;
    right: 0;
    left: 0;
    height: 0;
    pointer-events: none;
    transform: translateY(-1px);
}

.agenda-now-line {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    border-top: 1px solid var(--agenda-accent);
    content: '';
    opacity: .9;
}

.agenda-now-arrow {
    position: absolute;
    top: -4px;
    left: -1px;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid var(--agenda-accent);
}

.agenda-now-label {
    position: absolute;
    top: -10px;
    left: 8px;
    padding: 2px 5px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 48%, transparent);
    border-radius: 4px;
    color: var(--accent-text, #171713);
    background: var(--agenda-accent);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--agenda-accent) 22%, transparent);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

/* Give imported blocks enough typographic hierarchy to scan at a glance. */
.agenda-event {
    gap: 4px;
    padding: 8px 9px 7px 11px;
}

.agenda-event-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11.5px;
    line-height: 1.22;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.agenda-event-time,
.agenda-event-location {
    font-size: 9.5px;
}

.agenda-event.is-compact {
    gap: 2px;
    padding-top: 7px;
}

.agenda-event.is-compact .agenda-event-title {
    -webkit-line-clamp: 1;
}

@media (max-width: 980px) {
    .agenda-panel-header-meta {
        gap: 8px;
    }

    .agenda-week-label {
        display: none;
    }
}

@media (max-width: 720px) {
    .agenda-panel-header {
        align-items: flex-start;
    }

    .agenda-panel-header-meta {
        align-items: flex-end;
        flex-direction: column;
        gap: 6px;
    }

    .agenda-timezone {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .agenda-week-nav-button,
    .agenda-day-heading {
        transition: none;
    }
}

/* Agenda uses the site's neutral scrollbar; the selected accent is reserved
   for intentional affordances such as day labels and the uploader. */
.agenda-view-scroll {
    scrollbar-color: #ffffff transparent;
}

.agenda-view-scroll::-webkit-scrollbar {
    width: 8px;
}

.agenda-view-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.agenda-view-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #ffffff;
    background-clip: padding-box;
}

/* Calm defaults for schedule blocks. An editor-selected swatch is applied as
   an inline custom property by agenda.js and intentionally wins here. */
.agenda-event--school,
.agenda-event--study,
.agenda-event--sport,
.agenda-event--appointment,
.agenda-event--personal { --event-color: #c8ced6; }

.agenda-agent-send {
    color: #ffffff;
}

.agenda-agent-send svg {
    color: #ffffff;
}

.agenda-agent-send:not(:disabled):hover,
.agenda-agent-send:not(:disabled):focus-visible {
    color: #ffffff;
}

.agenda-agent-reply {
    max-width: min(100%, 420px);
    padding: 7px 11px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 24%, var(--agenda-soft-line));
    border-radius: 13px 13px 13px 4px;
    color: var(--text-primary, #f5f4ef);
    background: color-mix(in srgb, var(--agenda-surface) 88%, white 12%);
    font-size: 10px;
    line-height: 1.4;
    white-space: normal;
}

.agenda-agent-reply[data-tone="sending"] {
    color: var(--text-primary, #f5f4ef);
}

.agenda-agent-reply[data-tone="info"] {
    color: var(--text-primary, #f5f4ef);
}

.agenda-agent-companion {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    z-index: 4;
    display: inline-flex;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
    animation: agenda-agent-arrive 520ms cubic-bezier(.2,.8,.2,1) both;
}

.agenda-agent-companion[hidden] {
    display: none;
}

.agenda-agent-mascot {
    display: grid;
    width: 48px;
    height: 56px;
    padding: 5px 6px 3px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 42%, var(--agenda-soft-line));
    border-radius: 17px 17px 15px 15px;
    color: var(--agenda-accent);
    background: color-mix(in srgb, var(--agenda-surface) 84%, white 16%);
    box-shadow: 0 10px 25px rgb(0 0 0 / 20%), 0 0 0 5px color-mix(in srgb, var(--agenda-accent) 7%, transparent);
    animation: agenda-flame-float 2.8s ease-in-out infinite;
}

.agenda-agent-mascot svg {
    width: 35px;
    height: 43px;
}

.agenda-agent-mascot .agenda-flame-inner {
    color: var(--agenda-accent);
}

.agenda-agent-companion-name {
    margin-bottom: 8px;
    padding: 5px 8px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 999px;
    color: var(--text-secondary, #aaa69d);
    background: var(--agenda-surface);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .02em;
    box-shadow: 0 6px 16px rgb(0 0 0 / 12%);
}

@keyframes agenda-agent-arrive {
    from { opacity: 0; transform: translateY(12px) scale(.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes agenda-flame-float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-4px) rotate(1deg); }
}

.agenda-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
}

.agenda-color-swatch {
    position: relative;
    display: grid;
    width: 28px;
    height: 28px;
    padding: 3px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--swatch-color) 72%, var(--agenda-line));
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.agenda-color-swatch > span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--swatch-color);
}

.agenda-color-swatch svg {
    position: absolute;
    width: 15px;
    height: 15px;
    color: #26313a;
    opacity: 0;
    transition: opacity 140ms ease;
}

.agenda-color-swatch[aria-checked="true"] {
    border-color: var(--swatch-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--swatch-color) 28%, transparent);
    transform: scale(1.08);
}

.agenda-color-swatch[aria-checked="true"] svg {
    opacity: .92;
}

.agenda-color-swatch:hover,
.agenda-color-swatch:focus-visible {
    transform: scale(1.08);
    outline: none;
}

@media (max-width: 768px) {
    .agenda-agent-companion {
        right: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .agenda-agent-companion,
    .agenda-agent-mascot {
        animation: none;
    }
}

/* Match Chat: the header is a flat, continuous row. The rounded surface
   belongs to the Agenda composer below, not behind the page title. */
#agendaView > .agenda-view-scroll > .agenda-page-header {
    position: relative;
    overflow: visible;
    border: 0;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#agendaView > .agenda-view-scroll > .agenda-page-header::after {
    position: absolute;
    right: 30px;
    bottom: 0;
    left: 30px;
    height: 1px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-color, var(--agenda-soft-line)) 58%, transparent);
    content: '';
    pointer-events: none;
}

/* The context action is intentionally a quiet, icon-only control. */
.agenda-context-send {
    display: flex;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 12px 0 0 auto;
    padding: 0;
    border-radius: 50%;
}

.agenda-context-send svg {
    width: 17px;
    height: 17px;
}

.agenda-context-send:disabled {
    opacity: 1;
    color: rgb(255 255 255 / 72%);
    background: color-mix(in srgb, var(--agenda-accent) 30%, var(--agenda-surface-strong));
    border-color: color-mix(in srgb, var(--agenda-accent) 24%, var(--agenda-soft-line));
    cursor: not-allowed;
}

/* The mascot carries the identity; keep the composer quiet and reveal its
   name only as a small hover/focus hint. */
.agenda-agent-companion::before {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    padding: 4px 7px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 22%, var(--agenda-soft-line));
    border-radius: 8px;
    color: var(--text-secondary, #aaa69d);
    background: color-mix(in srgb, var(--agenda-surface) 92%, white 8%);
    content: attr(aria-label);
    font-size: 10px;
    font-weight: 650;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 140ms ease, transform 140ms ease;
    white-space: nowrap;
}

.agenda-agent-companion:hover::before,
.agenda-agent-companion:focus-visible::before {
    opacity: 1;
    transform: translateY(0);
}

/* The mascot is a freestanding mark, not another card in the composer. */
.agenda-agent-companion {
    position: fixed;
    right: 24px;
    bottom: 176px;
    display: flex;
    align-items: flex-end;
    width: var(--mascot-size, 128px);
    height: var(--mascot-size, 128px);
    gap: 0;
    max-width: none;
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

.agenda-agent-companion.is-dragging {
    z-index: 12;
    cursor: grabbing;
}

/* The mascot is portalled to body by Agenda JS. It must be above the Agenda
   canvas and outside its overflow/transform chain while still disappearing
   with the Agenda view itself. */
body > .agenda-agent-companion.agenda-agent-companion--viewport {
    position: fixed;
    right: 24px;
    bottom: 148px;
    z-index: 24;
}

body > .agenda-agent-companion.agenda-agent-companion--viewport.is-dragging {
    z-index: 25;
}

body > .agenda-agent-companion.agenda-agent-companion--viewport.is-agenda-view-hidden {
    display: none;
}

body > .agenda-agent-companion.agenda-agent-companion--viewport .agenda-mascot-art {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.agenda-agent-companion:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--agenda-accent) 74%, transparent);
    outline-offset: 7px;
    border-radius: 24px;
}

.agenda-agent-mascot {
    position: relative;
    display: block;
    width: var(--mascot-size, 128px);
    height: var(--mascot-size, 128px);
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--agenda-accent);
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 12px 10px rgb(0 0 0 / 22%));
    touch-action: none;
    animation: none;
    transform: none;
}

.agenda-mascot-art {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    --mascot-facing: 1;
    transform: scaleX(var(--mascot-facing));
    transform-origin: 50% 85%;
}

.agenda-agent-mascot .agenda-mascot-limbs {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Original brand asset, now mirrored with the whole character to communicate
   direction. Never regenerate the mark or distort its proportions. */
.agenda-mascot-logo {
    position: absolute;
    top: 0;
    left: 6.25%;
    width: 87.5%;
    height: 93.75%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.agenda-mascot-logo-pixels {
    image-rendering: pixelated;
}

.agenda-mascot-logo[hidden] { display: none; }

html[data-theme="light"] .agenda-mascot-logo,
body.light-mode .agenda-mascot-logo {
    filter: brightness(0);
}

.agenda-agent-companion[data-facing="left"] .agenda-mascot-art {
    --mascot-facing: -1;
}

.agenda-mascot-limb,
.agenda-mascot-joint,
.agenda-mascot-foot {
    transform-box: view-box;
}

.agenda-mascot-limb.arm-left { transform-origin: 30px 84px; }
.agenda-mascot-limb.arm-right { transform-origin: 98px 84px; }
.agenda-mascot-limb.leg-left { transform-origin: 55px 102px; }
.agenda-mascot-limb.leg-right { transform-origin: 73px 102px; }
.agenda-mascot-joint.elbow-left { transform-origin: 26px 92px; }
.agenda-mascot-joint.elbow-right { transform-origin: 102px 92px; }
.agenda-mascot-joint.knee-left { transform-origin: 55px 110px; }
.agenda-mascot-joint.knee-right { transform-origin: 73px 110px; }
.agenda-mascot-foot.foot-left { transform-origin: 55px 116px; }
.agenda-mascot-foot.foot-right { transform-origin: 73px 116px; }

.agenda-agent-companion.is-dragging.is-walking .agenda-mascot-art {
    animation: agenda-mascot-body-step 800ms cubic-bezier(.45, 0, .55, 1) infinite;
}

.agenda-agent-companion.is-dragging.is-walking .agenda-mascot-limb {
    /* Short, soft limbs follow a continuous opposing walk cycle. */
    animation: agenda-mascot-stride 800ms linear infinite;
}

.agenda-agent-companion.is-dragging.is-walking .arm-left,
.agenda-agent-companion.is-dragging.is-walking .arm-right {
    animation-name: agenda-mascot-arm-swing;
}

.agenda-agent-companion.is-dragging.is-walking .arm-right,
.agenda-agent-companion.is-dragging.is-walking .leg-left {
    animation-delay: -400ms;
}

.agenda-agent-companion.is-dragging.is-walking .elbow-left,
.agenda-agent-companion.is-dragging.is-walking .elbow-right {
    animation: agenda-mascot-elbow 800ms linear infinite;
}

.agenda-agent-companion.is-dragging.is-walking .knee-left,
.agenda-agent-companion.is-dragging.is-walking .knee-right {
    animation: agenda-mascot-knee 800ms linear infinite;
}

.agenda-agent-companion.is-dragging.is-walking .agenda-mascot-foot {
    animation: agenda-mascot-foot-roll 800ms linear infinite;
}

.agenda-agent-companion.is-dragging.is-walking .elbow-right,
.agenda-agent-companion.is-dragging.is-walking .knee-left,
.agenda-agent-companion.is-dragging.is-walking .foot-left {
    animation-delay: -400ms;
}

@keyframes agenda-mascot-stride {
    0%, 100% { transform: rotate(-24deg); }
    6.25%, 93.75% { transform: rotate(-22deg); }
    12.5%, 87.5% { transform: rotate(-17deg); }
    18.75%, 81.25% { transform: rotate(-9deg); }
    25%, 75% { transform: rotate(0deg); }
    31.25%, 68.75% { transform: rotate(9deg); }
    37.5%, 62.5% { transform: rotate(17deg); }
    43.75%, 56.25% { transform: rotate(22deg); }
    50% { transform: rotate(24deg); }
}

@keyframes agenda-mascot-body-step {
    0%, 50%, 100% { transform: translateY(0) scaleX(var(--mascot-facing)); }
    25%, 75% { transform: translateY(-3px) scaleX(var(--mascot-facing)); }
}

@keyframes agenda-mascot-arm-swing {
    0%, 100% { transform: rotate(-15deg); }
    12.5%, 87.5% { transform: rotate(-10deg); }
    25%, 75% { transform: rotate(0deg); }
    37.5%, 62.5% { transform: rotate(10deg); }
    50% { transform: rotate(15deg); }
}

@keyframes agenda-mascot-elbow {
    0%, 100% { transform: rotate(12deg); }
    6.25% { transform: rotate(16deg); }
    12.5% { transform: rotate(22deg); }
    18.75% { transform: rotate(29deg); }
    25% { transform: rotate(34deg); }
    31.25% { transform: rotate(36deg); }
    37.5% { transform: rotate(34deg); }
    43.75% { transform: rotate(29deg); }
    50% { transform: rotate(22deg); }
    56.25% { transform: rotate(16deg); }
    62.5% { transform: rotate(12deg); }
    68.75% { transform: rotate(9deg); }
    75% { transform: rotate(8deg); }
    81.25% { transform: rotate(8deg); }
    87.5% { transform: rotate(9deg); }
    93.75% { transform: rotate(10deg); }
}

@keyframes agenda-mascot-knee {
    0%, 62.5%, 75%, 87.5%, 100% { transform: rotate(0deg); }
    6.25% { transform: rotate(4deg); }
    12.5% { transform: rotate(12deg); }
    18.75% { transform: rotate(24deg); }
    25% { transform: rotate(34deg); }
    31.25% { transform: rotate(38deg); }
    37.5% { transform: rotate(32deg); }
    43.75% { transform: rotate(22deg); }
    50% { transform: rotate(10deg); }
    56.25% { transform: rotate(3deg); }
}

@keyframes agenda-mascot-foot-roll {
    0%, 100% { transform: rotate(-8deg); }
    12.5% { transform: rotate(-3deg); }
    25% { transform: rotate(8deg); }
    37.5% { transform: rotate(12deg); }
    50% { transform: rotate(4deg); }
    62.5%, 75% { transform: rotate(0deg); }
    87.5% { transform: rotate(-4deg); }
}

@media (prefers-reduced-motion: reduce) {
    .agenda-mascot-art { animation: none !important; }
    .agenda-mascot-limbs,
    .agenda-mascot-limb,
    .agenda-mascot-joint,
    .agenda-mascot-foot {
        animation: none !important;
        transform: none !important;
    }
}

.agenda-agent-companion-name {
    display: none;
}

.agenda-agent-reply {
    position: relative;
    flex: 0 1 auto;
    align-self: flex-end;
    grid-column: auto;
    grid-row: auto;
    max-width: min(320px, calc(100vw - 112px));
    margin: 0 0 12px;
    border-radius: 16px 16px 5px 16px;
    box-shadow: 0 10px 26px rgb(0 0 0 / 17%);
}

.agenda-agent-reply::after {
    position: absolute;
    right: -6px;
    bottom: 9px;
    width: 11px;
    height: 11px;
    border-right: 1px solid color-mix(in srgb, var(--agenda-accent) 24%, var(--agenda-soft-line));
    border-bottom: 1px solid color-mix(in srgb, var(--agenda-accent) 24%, var(--agenda-soft-line));
    background: color-mix(in srgb, var(--agenda-surface) 88%, white 12%);
    content: '';
    transform: rotate(-45deg);
}

@media (max-width: 768px) {
    .agenda-agent-companion {
        right: 16px;
        bottom: calc(150px + env(safe-area-inset-bottom, 0px));
    }

    body > .agenda-agent-companion.agenda-agent-companion--viewport {
        right: 16px;
        bottom: calc(140px + var(--mobile-safe-bottom, env(safe-area-inset-bottom, 0px)));
    }
}

/* Recurrence is an intentional user choice. The amber marker is reserved for
   events that repeat weekly; needs-review events remain dashed without the dot. */
.agenda-event.is-recurring::after {
    background: #efc36d;
    box-shadow: 0 0 0 3px color-mix(in srgb, #efc36d 16%, transparent);
}

.agenda-toolbar-button.is-recurring-action {
    border-color: color-mix(in srgb, #efc36d 38%, var(--agenda-soft-line));
    color: #d8b66e;
}

.agenda-toolbar-button.is-recurring-action:hover:not(:disabled),
.agenda-toolbar-button.is-recurring-action:focus-visible:not(:disabled) {
    border-color: #efc36d;
    color: #f0cb7b;
    background: color-mix(in srgb, #efc36d 12%, var(--agenda-surface-strong));
}

.agenda-recurring-toggle {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 11px;
    color: var(--text-primary, #f5f4ef);
    background: color-mix(in srgb, var(--agenda-surface) 74%, transparent);
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease;
}

.agenda-recurring-toggle:hover {
    border-color: color-mix(in srgb, #efc36d 42%, var(--agenda-soft-line));
    background: color-mix(in srgb, #efc36d 6%, var(--agenda-surface));
}

.agenda-recurring-toggle > input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.agenda-switch-track {
    position: relative;
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 20px;
    align-items: center;
    padding: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-secondary, #aaa69d) 34%, transparent);
    transition: background 160ms ease;
}

.agenda-switch-thumb {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgb(0 0 0 / 26%);
    transition: transform 160ms ease;
}

.agenda-recurring-toggle > input:checked + .agenda-switch-track {
    background: #c79c4e;
}

.agenda-recurring-toggle > input:checked + .agenda-switch-track .agenda-switch-thumb {
    transform: translateX(14px);
}

.agenda-recurring-toggle > input:focus-visible + .agenda-switch-track {
    outline: 2px solid color-mix(in srgb, #efc36d 70%, transparent);
    outline-offset: 3px;
}

.agenda-recurring-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.agenda-recurring-copy strong {
    font-size: 11px;
    font-weight: 750;
}

.agenda-recurring-copy small {
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    line-height: 1.3;
}

/* Keep the mascot freestanding; the voice control lives in the composer so
   it is available before the companion appears. */
.agenda-agent-mascot-stack {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.agenda-agent-reply {
    max-width: min(370px, calc(100vw - 142px));
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.45;
}

@keyframes agenda-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgb(184 92 103 / 28%), 0 6px 16px rgb(0 0 0 / 18%); }
    50% { box-shadow: 0 0 0 7px rgb(184 92 103 / 0%), 0 7px 18px rgb(0 0 0 / 24%); }
}

@media (max-width: 768px) {
    .agenda-agent-reply {
        max-width: min(300px, calc(100vw - 112px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .agenda-agent-mascot-stack,
    .agenda-agent-mascot-stack * {
        animation: none !important;
    }
}

/* Final Agenda Agent interaction polish. Keep the mascot anchored to the
 * right edge of its floating stage while the speech bubble changes width. */
.agenda-agent-companion {
    --mascot-size: 128px;
    width: var(--mascot-size);
    height: var(--mascot-size);
    justify-content: flex-end;
    animation: none;
    transform: none;
}

.agenda-agent-mascot-stack {
    flex: 0 0 var(--mascot-size, 128px);
}

.agenda-agent-mascot {
    flex: 0 0 auto;
}

.agenda-agent-reply {
    position: absolute;
    right: calc(100% + 10px);
    bottom: 12px;
    width: min(370px, calc(100vw - 142px));
    max-width: none;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 420ms ease, transform 420ms ease;
}

.agenda-agent-reply.is-fading {
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px) scale(.98);
}

.agenda-agent-reply.is-expanded {
    max-height: 40dvh;
    overflow-y: auto;
    white-space: pre-line;
    font-size: 15px;
    line-height: 1.5;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .agenda-agent-companion {
        --mascot-size: 112px;
        width: var(--mascot-size);
        height: var(--mascot-size);
        max-width: none;
    }

    .agenda-agent-reply {
        width: min(320px, calc(100vw - 112px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .agenda-agent-reply {
        transition: none;
    }
}

/* Reversible agent actions stay close to the composer without becoming a
   second chat bubble. The snapshot remains available to the text command even
   after this compact toast fades away. */
.agenda-agent-undo-toast {
    position: fixed;
    z-index: 8;
    right: calc(max(var(--agenda-content-gutter), (100% - var(--agenda-content-max)) / 2) + var(--agenda-context-width) + var(--agenda-panel-gap) + var(--agenda-panel-padding));
    bottom: 158px;
    left: calc(max(var(--agenda-content-gutter), (100% - var(--agenda-content-max)) / 2) + var(--agenda-panel-padding));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 7px 9px 7px 13px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 26%, var(--agenda-soft-line));
    border-radius: 13px;
    color: var(--text-primary, #f5f4ef);
    background: color-mix(in srgb, var(--agenda-surface-strong) 94%, var(--agenda-accent) 6%);
    box-shadow: 0 12px 28px rgb(0 0 0 / 20%);
}

.agenda-agent-undo-toast[hidden] {
    display: none !important;
}

.agenda-agent-undo-toast > span {
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary, #aaa69d);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-agent-undo-toast button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 48%, var(--agenda-soft-line));
    border-radius: 9px;
    color: var(--accent-text, #171713);
    background: var(--agenda-accent);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.agenda-agent-undo-toast button:hover,
.agenda-agent-undo-toast button:focus-visible {
    filter: brightness(1.08);
    outline: none;
}

@media (max-width: 768px) {
    .agenda-agent-undo-toast {
        right: calc(var(--agenda-content-gutter) + var(--agenda-panel-padding));
        bottom: calc(12px + var(--mobile-safe-bottom, 0px) + 142px);
        left: calc(var(--agenda-content-gutter) + var(--agenda-panel-padding));
    }
}

/* Clean marching-ants dropzone border: the dashes travel along the actual
 * rounded perimeter instead of rotating the border as a whole. */
.agenda-dropzone > .agenda-dropzone-border {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    color: var(--agenda-accent);
    opacity: .24;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.agenda-dropzone-border rect {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 14 12;
    stroke-dashoffset: 0;
    vector-effect: non-scaling-stroke;
}

.agenda-dropzone:hover > .agenda-dropzone-border,
.agenda-dropzone:focus-visible > .agenda-dropzone-border,
.agenda-dropzone.is-dragging > .agenda-dropzone-border {
    opacity: .9;
}

.agenda-dropzone:hover > .agenda-dropzone-border rect,
.agenda-dropzone.is-dragging > .agenda-dropzone-border rect {
    animation: agenda-dropzone-dash-flow .95s linear infinite;
}

@keyframes agenda-dropzone-dash-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -26; }
}

@media (prefers-reduced-motion: reduce) {
.agenda-dropzone:hover > .agenda-dropzone-border rect,
.agenda-dropzone.is-dragging > .agenda-dropzone-border rect {
    animation: none;
}
}

/* The view control belongs to the same toolbar as event selection. The
 * compact sliders-and-label treatment is easier to understand than a gear. */
.agenda-schedule-toolbar > .agenda-view-settings {
    z-index: 12;
    margin-left: auto;
}

.agenda-schedule-toolbar .agenda-view-settings-button {
    width: auto;
    min-width: 64px;
    height: 30px;
    min-height: 30px;
    gap: 6px;
    padding: 0 10px;
    border-radius: 8px;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .01em;
}

.agenda-schedule-toolbar .agenda-view-settings-button svg {
    width: 15px;
    height: 15px;
}

.agenda-schedule-toolbar .agenda-view-settings-popover {
    top: calc(100% + 10px);
    right: 0;
    bottom: auto;
}

.agenda-context-notes {
    margin-top: 14px;
    padding: 13px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--agenda-surface-strong) 56%, transparent);
}

.agenda-context-notes-label {
    gap: 7px;
    font-size: 11px;
    font-weight: 750;
}

.agenda-context-notes-icon {
    width: 20px;
    height: 20px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--agenda-accent) 12%, transparent);
}

.agenda-context-notes textarea {
    min-height: 92px;
    max-height: 160px;
    margin-top: 11px;
    padding: 11px 12px;
    border-color: color-mix(in srgb, var(--agenda-soft-line) 88%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--agenda-surface) 84%, transparent);
    resize: vertical;
}

.agenda-context-notes-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.agenda-context-notes #agendaContextNotesHint {
    flex: 1 1 auto;
    margin: 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    line-height: 1.4;
}

.agenda-context-notes .agenda-context-send {
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
}

@media (max-width: 640px) {
    .agenda-context-notes {
        padding: 12px;
    }
}

/* --------------------------------------------------------------------------
   Personal OS — universal plans, knowledge graph and transparent memory
   -------------------------------------------------------------------------- */

#agendaView [hidden] {
    display: none !important;
}

.personal-os-new-button,
.personal-os-primary-button,
.personal-os-secondary-button,
.personal-os-danger-button,
.personal-os-quiet-button,
.personal-os-text-button {
    appearance: none;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.personal-os-new-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid color-mix(in srgb, var(--agenda-accent) 55%, transparent);
    border-radius: var(--logicum-radius-sm, 10px);
    background: var(--agenda-accent);
    color: var(--accent-text, #181713);
    font-size: 13px;
    font-weight: 800;
    transition: filter var(--logicum-motion-fast, 140ms) var(--logicum-ease, ease), border-color var(--logicum-motion-fast, 140ms) var(--logicum-ease, ease);
}

.personal-os-new-button > span:first-child {
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
}

.personal-os-new-button:hover {
    filter: brightness(1.06);
}

.personal-os-new-button:focus-visible,
.personal-os-primary-button:focus-visible,
.personal-os-secondary-button:focus-visible,
.personal-os-danger-button:focus-visible,
.personal-os-quiet-button:focus-visible,
.personal-os-text-button:focus-visible,
.personal-os-view-nav button:focus-visible,
.personal-os-table tbody tr:focus-visible,
.personal-os-item-card:focus-visible {
    outline: 2px solid var(--agenda-accent);
    outline-offset: 2px;
}

.personal-os-view-nav {
    display: flex;
    align-items: center;
    gap: 3px;
    width: max-content;
    max-width: 100%;
    margin: 0 auto 18px;
    padding: 4px;
    overflow-x: auto;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 13px;
    background: color-mix(in srgb, var(--agenda-surface-strong) 88%, transparent);
    scrollbar-width: none;
}

.personal-os-view-nav::-webkit-scrollbar {
    display: none;
}

.personal-os-view-nav button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 13px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary, #aaa69d);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--logicum-motion-fast, 140ms) var(--logicum-ease, ease), color var(--logicum-motion-fast, 140ms) var(--logicum-ease, ease);
}

.personal-os-view-nav button:hover {
    color: var(--text-primary, #f5f4ef);
}

.personal-os-view-nav button.is-active {
    background: var(--agenda-surface);
    color: var(--text-primary, #f5f4ef);
    box-shadow: inset 0 0 0 1px var(--agenda-soft-line);
}

.personal-os-panel {
    width: 100%;
    max-width: var(--agenda-content-max);
    margin: 0 auto;
}

.personal-os-overview {
    display: grid;
    gap: 16px;
}

.personal-os-overview-hero,
.personal-os-panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 2px 2px 4px;
}

.personal-os-overview-hero h2,
.personal-os-panel-heading h2 {
    margin: 5px 0 7px;
    color: var(--text-primary, #f5f4ef);
    font-size: clamp(21px, 2.4vw, 30px);
    font-weight: 720;
    letter-spacing: -0.025em;
    line-height: 1.14;
}

.personal-os-overview-hero p,
.personal-os-panel-heading p,
.personal-os-profile-card > p {
    max-width: 720px;
    margin: 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 13px;
    line-height: 1.55;
}

.personal-os-quiet-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--agenda-line);
    border-radius: 10px;
    background: var(--agenda-surface);
    color: var(--text-primary, #f5f4ef);
    font-size: 12px;
    font-weight: 700;
}

.personal-os-quiet-button svg {
    width: 15px;
    height: 15px;
}

.personal-os-quiet-button:hover {
    background: var(--agenda-agent-surface-hover);
}

.personal-os-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.personal-os-stat {
    position: relative;
    min-height: 94px;
    padding: 16px;
    overflow: hidden;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 15px;
    background: var(--agenda-surface);
}

.personal-os-stat::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 42px;
    border-radius: 0 0 0 42px;
    background: color-mix(in srgb, var(--agenda-accent) 10%, transparent);
    content: '';
}

.personal-os-stat strong {
    display: block;
    margin-bottom: 7px;
    color: var(--text-primary, #f5f4ef);
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.personal-os-stat span {
    color: var(--text-secondary, #aaa69d);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.personal-os-overview-grid,
.personal-os-memory-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 16px;
}

.personal-os-surface,
.personal-os-board-column,
.personal-os-table-panel,
.personal-os-graph-panel {
    min-width: 0;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 18px;
    background: var(--agenda-surface);
}

.personal-os-surface {
    padding: 18px;
}

.personal-os-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.personal-os-section-header h3 {
    margin: 3px 0 0;
    color: var(--text-primary, #f5f4ef);
    font-size: 16px;
    font-weight: 720;
    letter-spacing: -0.015em;
}

.personal-os-count {
    display: inline-flex;
    min-width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 999px;
    color: var(--text-secondary, #aaa69d);
    font-size: 11px;
    font-weight: 800;
}

.personal-os-text-button {
    padding: 5px;
    background: transparent;
    color: var(--agenda-accent);
    font-size: 12px;
    font-weight: 750;
}

.personal-os-text-button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.personal-os-suggestion-list,
.personal-os-upcoming-list,
.personal-os-memory-list,
.personal-os-context-audit-list {
    display: grid;
    gap: 8px;
}

.personal-os-suggestion,
.personal-os-upcoming-item,
.personal-os-memory-item,
.personal-os-context-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--agenda-surface-strong) 76%, transparent);
}

.personal-os-suggestion-mark,
.personal-os-kind-mark {
    display: inline-flex;
    width: 29px;
    height: 29px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: color-mix(in srgb, var(--agenda-accent) 13%, transparent);
    color: var(--agenda-accent);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.personal-os-suggestion.is-high .personal-os-suggestion-mark {
    background: color-mix(in srgb, #d87368 14%, transparent);
    color: #e99388;
}

.personal-os-suggestion-copy,
.personal-os-item-copy {
    min-width: 0;
}

.personal-os-suggestion-copy strong,
.personal-os-item-copy strong,
.personal-os-memory-item strong {
    display: block;
    overflow: hidden;
    color: var(--text-primary, #f5f4ef);
    font-size: 12px;
    font-weight: 720;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.personal-os-suggestion-copy span,
.personal-os-item-copy span,
.personal-os-memory-item p,
.personal-os-context-item p {
    display: block;
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--text-secondary, #aaa69d);
    font-size: 11px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.personal-os-severity,
.personal-os-status-pill,
.personal-os-confidence,
.personal-os-scope-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 999px;
    color: var(--text-secondary, #aaa69d);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.personal-os-area-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.personal-os-area-card {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--agenda-surface-strong) 74%, transparent);
}

.personal-os-area-card span {
    display: block;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    font-weight: 750;
    text-transform: capitalize;
}

.personal-os-area-card strong {
    display: block;
    margin-top: 5px;
    color: var(--text-primary, #f5f4ef);
    font-size: 20px;
    font-weight: 740;
}

.personal-os-trust-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
}

.personal-os-trust-note i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #78a987;
    box-shadow: 0 0 0 3px color-mix(in srgb, #78a987 14%, transparent);
}

.personal-os-empty {
    display: flex;
    min-height: 105px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 18px;
    border: 1px dashed var(--agenda-line);
    border-radius: 12px;
    color: var(--text-secondary, #aaa69d);
    text-align: center;
}

.personal-os-empty strong {
    color: var(--text-primary, #f5f4ef);
    font-size: 12px;
}

.personal-os-empty span {
    max-width: 360px;
    font-size: 11px;
    line-height: 1.45;
}

.personal-os-board,
.personal-os-table-panel,
.personal-os-graph-panel,
.personal-os-memory-panel {
    animation: personal-os-panel-in var(--logicum-motion-base, 180ms) var(--logicum-ease, ease);
}

@keyframes personal-os-panel-in {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

.personal-os-board-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.personal-os-board-column {
    min-height: 320px;
    padding: 13px;
}

.personal-os-board-column header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 11px;
}

.personal-os-board-column header strong {
    color: var(--text-primary, #f5f4ef);
    font-size: 12px;
}

.personal-os-board-column-items {
    display: grid;
    gap: 8px;
}

.personal-os-item-card {
    padding: 12px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 11px;
    background: var(--agenda-surface-strong);
    cursor: pointer;
}

.personal-os-item-card:hover {
    border-color: color-mix(in srgb, var(--agenda-accent) 38%, var(--agenda-soft-line));
}

.personal-os-item-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.personal-os-item-card h4 {
    margin: 0 0 5px;
    color: var(--text-primary, #f5f4ef);
    font-size: 12px;
    line-height: 1.35;
}

.personal-os-item-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    line-height: 1.45;
}

.personal-os-table-panel,
.personal-os-graph-panel {
    padding: 18px;
}

.personal-os-table-heading {
    align-items: center;
}

.personal-os-search input {
    width: min(300px, 36vw);
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--agenda-line);
    border-radius: 10px;
    outline: none;
    background: var(--agenda-surface-strong);
    color: var(--text-primary, #f5f4ef);
    font: inherit;
    font-size: 12px;
}

.personal-os-search input:focus {
    border-color: var(--agenda-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--agenda-accent) 14%, transparent);
}

.personal-os-table-wrap {
    margin-top: 14px;
    overflow: auto;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 13px;
}

.personal-os-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary, #f5f4ef);
    font-size: 11px;
}

.personal-os-table th,
.personal-os-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--agenda-soft-line);
    text-align: left;
    white-space: nowrap;
}

.personal-os-table th {
    color: var(--text-secondary, #aaa69d);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.personal-os-table tbody tr {
    cursor: pointer;
}

.personal-os-table tbody tr:hover {
    background: color-mix(in srgb, var(--agenda-accent) 6%, transparent);
}

.personal-os-table tbody tr:last-child td {
    border-bottom: 0;
}

.personal-os-table-item {
    display: flex;
    min-width: 210px;
    align-items: center;
    gap: 9px;
}

.personal-os-table-item span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.personal-os-graph-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    min-height: 520px;
    margin-top: 15px;
    overflow: hidden;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 14px;
    background: var(--agenda-surface-strong);
}

.personal-os-graph {
    /* vis-network's percentage-height canvas needs a definite parent height. */
    height: 520px;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    border-right: 1px solid var(--agenda-soft-line);
}

.personal-os-graph-details {
    padding: 17px;
    color: var(--text-secondary, #aaa69d);
    font-size: 11px;
    line-height: 1.55;
}

.personal-os-graph-details h3 {
    margin: 0 0 8px;
    color: var(--text-primary, #f5f4ef);
    font-size: 16px;
}

.personal-os-graph-details dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    margin: 14px 0 0;
}

.personal-os-graph-details dt {
    color: var(--text-secondary, #aaa69d);
}

.personal-os-graph-details dd {
    margin: 0;
    color: var(--text-primary, #f5f4ef);
}

.personal-os-memory-panel {
    display: grid;
    gap: 16px;
}

.personal-os-profile-fields,
.personal-os-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.personal-os-profile-fields {
    margin: 18px 0 14px;
}

.personal-os-memory-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    color: var(--text-secondary, #aaa69d);
    font-size: 12px;
    line-height: 1.45;
}

.personal-os-memory-consent input {
    margin-top: 2px;
    accent-color: var(--agenda-accent);
}

.personal-os-profile-fields label,
.personal-os-form-grid label,
.personal-os-form-grid fieldset {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    font-weight: 700;
}

.personal-os-profile-fields select,
.personal-os-form-grid input,
.personal-os-form-grid select,
.personal-os-form-grid textarea {
    width: 100%;
    min-height: 39px;
    padding: 9px 11px;
    border: 1px solid var(--agenda-line);
    border-radius: 10px;
    outline: none;
    background: var(--agenda-surface-strong);
    color: var(--text-primary, #f5f4ef);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    resize: vertical;
}

.personal-os-profile-fields select:focus,
.personal-os-form-grid input:focus,
.personal-os-form-grid select:focus,
.personal-os-form-grid textarea:focus {
    border-color: var(--agenda-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--agenda-accent) 14%, transparent);
}

.personal-os-form-grid label > small {
    color: var(--text-secondary, #aaa69d);
    font-size: 9px;
    font-weight: 500;
}

.personal-os-primary-button,
.personal-os-secondary-button,
.personal-os-danger-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 750;
}

.personal-os-primary-button {
    background: var(--agenda-accent);
    color: var(--accent-text, #181713);
}

.personal-os-primary-button:hover {
    filter: brightness(1.06);
}

.personal-os-primary-button:disabled {
    cursor: wait;
    filter: grayscale(0.5);
    opacity: 0.62;
}

.personal-os-secondary-button {
    border: 1px solid var(--agenda-line);
    background: var(--agenda-surface-strong);
    color: var(--text-primary, #f5f4ef);
}

.personal-os-danger-button {
    border: 1px solid color-mix(in srgb, #d87368 35%, transparent);
    background: color-mix(in srgb, #d87368 9%, transparent);
    color: #e99388;
}

.personal-os-inline-status {
    min-height: 16px;
    margin: 8px 0 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
}

.personal-os-inline-status.is-error {
    color: #e99388;
}

.personal-os-inline-status.is-success {
    color: #8cc49b;
}

.personal-os-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary, #aaa69d);
    cursor: pointer;
    font-size: 10px;
}

.personal-os-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.personal-os-switch > span {
    position: relative;
    width: 36px;
    height: 21px;
    border: 1px solid var(--agenda-line);
    border-radius: 999px;
    background: var(--agenda-surface-strong);
}

.personal-os-switch i {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--text-secondary, #aaa69d);
    transition: transform var(--logicum-motion-fast, 140ms) var(--logicum-ease, ease), background var(--logicum-motion-fast, 140ms) var(--logicum-ease, ease);
}

.personal-os-switch input:checked + span {
    border-color: color-mix(in srgb, var(--agenda-accent) 65%, transparent);
    background: color-mix(in srgb, var(--agenda-accent) 24%, transparent);
}

.personal-os-switch input:checked + span i {
    transform: translateX(15px);
    background: var(--agenda-accent);
}

.personal-os-switch input:focus-visible + span {
    outline: 2px solid var(--agenda-accent);
    outline-offset: 2px;
}

.personal-os-memory-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.personal-os-memory-actions {
    display: flex;
    gap: 5px;
}

.personal-os-memory-actions button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #aaa69d);
    cursor: pointer;
}

.personal-os-memory-actions button:hover {
    color: var(--text-primary, #f5f4ef);
}

.personal-os-memory-actions [data-memory-edit] {
    width: auto;
    padding: 0 8px;
    font-size: 9px;
    font-weight: 700;
}

.personal-os-memory-reason {
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
}

.personal-os-context-item {
    grid-template-columns: minmax(0, 1fr) auto;
}

.personal-os-modal {
    position: fixed;
    z-index: 2220;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.personal-os-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 11, 10, 0.66);
    backdrop-filter: blur(8px);
}

.personal-os-dialog {
    position: relative;
    display: flex;
    width: min(650px, 100%);
    max-height: min(86vh, 820px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--agenda-line);
    border-radius: 20px;
    background: var(--agenda-surface);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
    animation: personal-os-dialog-in var(--logicum-motion-base, 180ms) var(--logicum-ease, ease);
}

@keyframes personal-os-dialog-in {
    from { opacity: 0; transform: translateY(6px) scale(0.992); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.personal-os-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 19px 20px 15px;
    border-bottom: 1px solid var(--agenda-soft-line);
}

.personal-os-dialog-header h2 {
    margin: 4px 0 0;
    color: var(--text-primary, #f5f4ef);
    font-size: 20px;
    font-weight: 730;
    letter-spacing: -0.02em;
}

.personal-os-dialog-header p {
    max-width: 650px;
    margin: 5px 0 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 11px;
    line-height: 1.45;
}

.personal-os-dialog-close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary, #aaa69d);
    font-size: 20px;
    cursor: pointer;
}

.personal-os-dialog-close:hover {
    color: var(--text-primary, #f5f4ef);
}

.personal-os-form {
    min-height: 0;
    padding: 18px 20px 20px;
    overflow-y: auto;
}

.personal-os-form-grid .is-wide {
    grid-column: 1 / -1;
}

.personal-os-scope-target[hidden] {
    display: none !important;
}

.personal-os-dialog-actions {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 8px;
    margin-top: 17px;
}

/* Review keeps the decision visible; editable fields are progressively disclosed. */
.personal-os-review-dialog {
    width: min(960px, 100%);
    max-height: 90dvh;
}

.personal-os-review-dialog > .personal-os-dialog-header,
.personal-os-review-dialog > .personal-os-dialog-actions,
.personal-os-review-dialog > .personal-os-inline-status {
    flex-shrink: 0;
}

.personal-os-review-dialog .personal-os-dialog-header h2 { font-size: 26px; }
.personal-os-review-dialog .personal-os-dialog-header p { font-size: 15px; line-height: 1.5; }
.personal-os-review-dialog #personalOsReviewSummary { font-size: 14px; }
.personal-os-review-dialog .personal-os-dialog-close { width: 44px; height: 44px; flex-basis: 44px; }

.personal-os-review-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.personal-os-review-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--agenda-soft-line);
    color: var(--text-secondary, #aaa69d);
    font-size: 14px;
    font-weight: 650;
}

.personal-os-review-toolbar label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.personal-os-review-toolbar input,
.personal-os-review-memory input,
.personal-os-review-relation input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--agenda-accent, #d0a85c); }

.personal-os-review-warnings {
    margin: 14px 20px 0;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, #e4c673 30%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, #e4c673 7%, transparent);
    color: #e4c673;
    font-size: 14px;
    line-height: 1.5;
}

.personal-os-review-list { display: grid; gap: 16px; padding: 20px; }

.personal-os-review-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px 20px;
    padding: 22px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 18px;
    background: var(--agenda-surface-strong);
}

.personal-os-review-card.is-selected { border-color: color-mix(in srgb, var(--agenda-accent, #d0a85c) 65%, var(--agenda-soft-line)); }
.personal-os-review-preview { min-width: 0; overflow-wrap: anywhere; }
.personal-os-review-item-title { margin: 0 0 8px; color: var(--text-primary, #f5f4ef); font-size: 21px; line-height: 1.35; }
.personal-os-review-item-info,
.personal-os-review-description { margin: 6px 0; color: var(--text-secondary, #aaa69d); font-size: 15px; line-height: 1.5; }
.personal-os-review-privacy { margin: 10px 0 0; color: var(--text-secondary, #aaa69d); font-size: 13px; line-height: 1.5; }
.personal-os-review-choices { display: flex; gap: 8px; }
.personal-os-review-choices button {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--agenda-line);
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary, #f5f4ef);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.personal-os-review-choices [aria-pressed="true"] { background: color-mix(in srgb, var(--text-secondary, #aaa69d) 16%, transparent); border-color: var(--text-secondary, #aaa69d); }
.personal-os-review-choices [data-review-choice="add"][aria-pressed="true"] { background: var(--agenda-accent, #d0a85c); color: #211f1b; border-color: var(--agenda-accent, #d0a85c); }
.personal-os-review-dialog :is(button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--agenda-accent, #d0a85c); outline-offset: 3px; }
.personal-os-review-editor { grid-column: 1 / -1; border-top: 1px solid var(--agenda-soft-line); padding-top: 12px; }
.personal-os-review-editor > summary,
.personal-os-review-advanced > summary,
.personal-os-review-relations-section > summary { min-height: 36px; padding: 7px 0; color: var(--text-primary, #f5f4ef); font-size: 14px; font-weight: 650; cursor: pointer; }

.personal-os-review-fields { display: grid; min-width: 0; gap: 14px; margin-top: 12px; }
.personal-os-review-primary-fields,
.personal-os-review-timing,
.personal-os-review-advanced-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.personal-os-review-primary-fields { grid-template-columns: minmax(0, 1fr) 180px; }
.personal-os-review-control { display: grid; min-width: 0; gap: 6px; color: var(--text-secondary, #aaa69d); font-size: 14px; font-weight: 600; }
.personal-os-review-control.is-wide { grid-column: 1 / -1; }
.personal-os-review-fields :is(input, select, textarea) {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--agenda-line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--agenda-surface) 84%, transparent);
    color: var(--text-primary, #f5f4ef);
    font: inherit;
    font-size: 16px;
}
.personal-os-review-fields textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.personal-os-review-evidence { margin: 0; color: var(--text-secondary, #aaa69d); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.personal-os-review-advanced { border-top: 1px solid var(--agenda-soft-line); }
.personal-os-review-advanced-grid { padding: 8px 0; }
.personal-os-review-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; grid-column: 1 / -1; }
.personal-os-review-meta .personal-os-confidence { font-size: 13px; }
.personal-os-review-memory { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary, #aaa69d); font-size: 14px; }
.personal-os-review-relations-section { margin: 0 20px 20px; padding: 12px 16px; border: 1px solid var(--agenda-soft-line); border-radius: 12px; }
.personal-os-review-relations-section p { font-size: 14px; color: var(--text-secondary, #aaa69d); line-height: 1.5; }
.personal-os-review-relations { display: grid; gap: 10px; }
.personal-os-review-relation { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--agenda-soft-line); border-radius: 10px; background: var(--agenda-surface-strong); cursor: pointer; }
.personal-os-review-relation-copy { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.personal-os-review-relation-copy strong { color: var(--text-primary, #f5f4ef); font-size: 15px; }
.personal-os-review-relation-copy :is(span, small) { color: var(--text-secondary, #aaa69d); font-size: 13px; line-height: 1.45; }
.personal-os-review-dialog > .personal-os-dialog-actions { margin: 0; padding: 16px 20px; border-top: 1px solid var(--agenda-soft-line); display: flex; flex-wrap: wrap; }
.personal-os-review-dialog > .personal-os-dialog-actions > span { flex: 1; }
.personal-os-review-dialog > .personal-os-dialog-actions button { min-height: 46px; padding: 10px 16px; font-size: 15px; }
.personal-os-review-dialog > .personal-os-inline-status { margin: 0; padding: 8px 20px; font-size: 14px; line-height: 1.5; }
.personal-os-review-dialog > .personal-os-inline-status:empty { display: none; }

.personal-os-delete-zone {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-color: color-mix(in srgb, #e4877d 35%, var(--agenda-line));
}

.personal-os-delete-zone h3 {
    margin: 5px 0;
    color: var(--text-primary, #f5f4ef);
    font-size: 14px;
}

.personal-os-delete-zone p:not(.personal-os-inline-status) {
    max-width: 760px;
    margin: 0;
    color: var(--text-secondary, #aaa69d);
    font-size: 10px;
    line-height: 1.5;
}

.personal-os-delete-zone .personal-os-inline-status {
    grid-column: 1 / -1;
    margin: 0;
}

.personal-os-pending-imports {
    display: grid;
    gap: 7px;
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid var(--agenda-soft-line);
}

.personal-os-pending-imports > header,
.personal-os-pending-import {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.personal-os-pending-imports > header h3 {
    margin: 0;
    color: var(--text-primary, #f5f4ef);
    font-size: 11px;
}

.personal-os-pending-imports > header span {
    color: var(--text-secondary, #aaa69d);
    font-size: 9px;
}

.personal-os-pending-import {
    padding: 9px;
    border: 1px solid var(--agenda-soft-line);
    border-radius: 9px;
    background: var(--agenda-surface-strong);
}

.personal-os-pending-import > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.personal-os-pending-import strong,
.personal-os-pending-import span {
    overflow: hidden;
    color: var(--text-primary, #f5f4ef);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.personal-os-pending-import span {
    color: var(--text-secondary, #aaa69d);
    font-size: 8px;
}

.personal-os-pending-import .personal-os-text-button {
    flex: 0 0 auto;
    font-size: 8px;
}

.personal-os-agent-permissions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px 16px !important;
    padding: 11px;
    border: 1px solid var(--agenda-line);
    border-radius: 10px;
}

.personal-os-agent-permissions legend {
    padding: 0 4px;
}

.personal-os-agent-permissions label {
    display: inline-flex;
    grid-auto-flow: column;
    align-items: center;
    gap: 5px;
}

.personal-os-agent-permissions input {
    width: auto;
    min-height: 0;
}

body.light-mode .personal-os-dialog {
    box-shadow: 0 28px 80px rgba(56, 48, 38, 0.2);
}

body.light-mode .personal-os-modal-backdrop {
    background: rgba(59, 52, 43, 0.34);
}

@media (max-width: 980px) {
    .personal-os-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .personal-os-overview-grid,
    .personal-os-memory-grid {
        grid-template-columns: 1fr;
    }

    .personal-os-board-grid {
        grid-template-columns: repeat(4, 250px);
    }

    .personal-os-graph-layout {
        grid-template-columns: 1fr;
    }

    .personal-os-graph {
        border-right: 0;
        border-bottom: 1px solid var(--agenda-soft-line);
    }
}

@media (max-width: 720px) {
    .personal-os-new-button span:last-child,
    .personal-os-quiet-button span {
        display: none;
    }

    .personal-os-new-button,
    .personal-os-quiet-button {
        width: 38px;
        padding: 0;
    }

    .personal-os-view-nav {
        width: 100%;
        margin-bottom: 14px;
    }

    .personal-os-overview-hero,
    .personal-os-panel-heading {
        align-items: flex-start;
    }

    .personal-os-overview-hero p,
    .personal-os-panel-heading > p {
        display: none;
    }

    .personal-os-stats {
        gap: 8px;
    }

    .personal-os-stat {
        min-height: 80px;
        padding: 13px;
    }

    .personal-os-stat strong {
        font-size: 21px;
    }

    .personal-os-surface,
    .personal-os-table-panel,
    .personal-os-graph-panel {
        padding: 14px;
        border-radius: 15px;
    }

    .personal-os-trust-note {
        display: none;
    }

    .personal-os-table-heading {
        display: grid;
    }

    .personal-os-search input {
        width: 100%;
    }

    .personal-os-graph-layout {
        min-height: 400px;
    }

    .personal-os-graph {
        height: 400px;
    }

    .personal-os-profile-fields,
    .personal-os-form-grid {
        grid-template-columns: 1fr;
    }

    .personal-os-form-grid .is-wide {
        grid-column: auto;
    }

    .personal-os-modal {
        align-items: flex-end;
        padding: 0;
    }

    .personal-os-dialog {
        width: 100%;
        max-height: 92dvh;
        border-radius: 20px 20px 0 0;
    }

    .personal-os-review-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .personal-os-review-card {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px;
    }

    .personal-os-review-list { padding: 14px; }
    .personal-os-review-choices { width: 100%; }
    .personal-os-review-choices button { flex: 1; }
    .personal-os-review-dialog .personal-os-dialog-header h2 { font-size: 22px; }
    .personal-os-review-dialog > .personal-os-dialog-actions { gap: 8px; padding: 12px 14px; }
    .personal-os-review-dialog > .personal-os-dialog-actions > span { display: none; }
    .personal-os-review-dialog > .personal-os-dialog-actions #personalOsCommitImportButton { flex: 1 0 100%; }

    .personal-os-review-fields {
        grid-template-columns: 1fr;
    }

    .personal-os-review-primary-fields,
    .personal-os-review-timing,
    .personal-os-review-advanced-grid {
        grid-template-columns: 1fr;
    }

    .personal-os-review-control.is-wide {
        grid-column: auto;
    }

    .personal-os-review-evidence {
        grid-column: auto;
    }

    .personal-os-review-relations-section {
        padding-right: 14px;
        padding-left: 14px;
    }

    .personal-os-review-relations-section header {
        align-items: flex-start;
        flex-direction: column;
    }

    .personal-os-delete-zone {
        grid-template-columns: 1fr;
    }

    .personal-os-delete-zone .personal-os-danger-button {
        width: fit-content;
    }

    .personal-os-review-meta {
        grid-column: 1 / -1;
    }

    .personal-os-dialog-actions {
        grid-template-columns: 1fr 1fr;
    }

    .personal-os-dialog-actions > span {
        display: none;
    }

    .personal-os-dialog-actions .personal-os-danger-button {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .personal-os-board,
    .personal-os-table-panel,
    .personal-os-graph-panel,
    .personal-os-memory-panel,
    .personal-os-dialog {
        animation: none;
    }

    .personal-os-switch i {
        transition: none;
    }
}

/* Keep Agenda flat and compact: no color wash, bloom, or diffuse shadows. */
#agendaView,
#agendaView::before,
#agendaView::after,
#agendaView *,
#agendaView *::before,
#agendaView *::after {
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

#agendaView :focus-visible {
    outline: 2px solid var(--agenda-accent) !important;
    outline-offset: 2px;
}

#agendaView .agenda-layout {
    min-width: 0;
}

#agendaView .agenda-schedule-panel,
#agendaView .agenda-context-panel {
    box-shadow: none !important;
}

#agendaView .agenda-calendar {
    width: 100%;
    grid-template-rows: 50px var(--agenda-calendar-height) !important;
    overflow-x: hidden;
    background: var(--agenda-surface-strong) !important;
}

#agendaView .agenda-calendar-corner,
#agendaView .agenda-day-heading {
    min-width: 0;
    min-height: 50px;
}

#agendaView .agenda-day-heading {
    padding: 6px 3px;
}

#agendaView .agenda-day-heading.is-today {
    background-color: transparent !important;
}

#agendaView .agenda-day-heading.is-today::after {
    right: 8px;
    left: 8px;
    opacity: 1;
}

#agendaView .agenda-day-column {
    min-width: 0;
    background: var(--agenda-surface-strong) !important;
}

#agendaView .agenda-slot {
    background-color: transparent !important;
}

#agendaView .agenda-slot:hover,
#agendaView .agenda-slot:focus-visible {
    background-color: color-mix(in srgb, var(--agenda-accent) 5%, var(--agenda-surface-strong)) !important;
    box-shadow: none !important;
}

#agendaView .agenda-event {
    background: color-mix(in srgb, var(--event-color) 14%, var(--agenda-surface-strong)) !important;
    box-shadow: none !important;
    transition: border-color 140ms ease, background-color 140ms ease;
    transform: none;
}

#agendaView .agenda-event:hover,
#agendaView .agenda-event:focus-visible {
    background: color-mix(in srgb, var(--event-color) 20%, var(--agenda-surface-strong)) !important;
    transform: none;
}

#agendaView .agenda-event.is-selected {
    border-color: var(--event-color) !important;
}

#agendaView .agenda-dropzone,
#agendaView .agenda-dropzone:hover,
#agendaView .agenda-dropzone:focus-visible,
#agendaView .agenda-dropzone.is-dragging,
#agendaView .agenda-dropzone.has-files,
#agendaView .agenda-dropzone.is-processing {
    background: color-mix(in srgb, var(--agenda-accent) 4%, var(--agenda-surface-strong)) !important;
    transform: none;
}

#agendaView .agenda-dropzone:hover,
#agendaView .agenda-dropzone:focus-visible {
    border-color: var(--agenda-soft-line);
}

#agendaView .agenda-analysis-rule i {
    left: 0;
    width: 100%;
    background: var(--agenda-accent) !important;
    animation: none !important;
}

/* This is the shared Chat input bubble, with Agenda's own fixed docking. */
#agendaView .agenda-agent-composer.chat-input-area {
    position: fixed !important;
    z-index: 70;
    display: flex !important;
    align-items: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    /* The Agenda agent is a primary action, so it is centred in the viewport
       instead of inheriting the calendar/context-panel column offsets. */
    top: auto !important;
    right: auto !important;
    bottom: 18px !important;
    left: 50% !important;
    width: min(800px, calc(100% - 32px));
    box-sizing: border-box;
    min-width: 0;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto !important;
    transform: translateX(-50%) !important;
}

#agendaView .agenda-agent-composer #agendaAgentInput {
    order: 2;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 40px !important;
    height: var(--logicum-chat-input-height, 40px) !important;
    max-height: 220px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text-primary, #f5f4ef) !important;
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    resize: none !important;
    overflow-y: hidden;
}

#agendaView .agenda-agent-companion {
    bottom: 148px;
}

#agendaView .agenda-agent-mascot {
    filter: none !important;
}

/* Keep the upload dash on the actual box perimeter at every aspect ratio. */
#agendaView .agenda-dropzone,
#agendaView .agenda-dropzone:hover,
#agendaView .agenda-dropzone:focus-visible,
#agendaView .agenda-dropzone.is-dragging,
#agendaView .agenda-dropzone.has-files,
#agendaView .agenda-dropzone.is-processing {
    border: 1px dashed color-mix(in srgb, var(--agenda-accent) 38%, var(--agenda-soft-line)) !important;
    border-radius: 16px !important;
}

#agendaView .agenda-dropzone:hover,
#agendaView .agenda-dropzone:focus-visible,
#agendaView .agenda-dropzone.is-dragging {
    border-color: color-mix(in srgb, var(--agenda-accent) 72%, var(--agenda-soft-line)) !important;
}

#agendaView .agenda-dropzone > .agenda-dropzone-border {
    display: none;
}

/* The import state stays out of the drop area: dim its contents and surface
   a quiet progress bar underneath the context controls. */
#agendaView .agenda-dropzone.is-processing > .agenda-dropzone-icon,
#agendaView .agenda-dropzone.is-processing > .agenda-dropzone-prompt,
#agendaView .agenda-dropzone.is-processing > .agenda-file-list {
    opacity: .42;
    filter: blur(1.2px) !important;
    pointer-events: none;
}

#agendaView .agenda-analysis-progress {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    margin: 12px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    text-align: left;
}

#agendaView .agenda-analysis-progress[hidden] {
    display: none !important;
}

#agendaView .agenda-analysis-copy {
    gap: 2px;
}

#agendaView .agenda-analysis-copy strong {
    font-size: 11px;
    font-weight: 700;
}

#agendaView .agenda-analysis-copy small {
    font-size: 10px;
}

#agendaView .agenda-analysis-rule {
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--agenda-accent) 16%, var(--agenda-soft-line)) !important;
}

#agendaView .agenda-analysis-rule i {
    left: -35%;
    width: 35%;
    border-radius: inherit;
    background: var(--agenda-accent) !important;
    animation: agenda-context-progress 1.5s ease-in-out infinite !important;
}

@keyframes agenda-context-progress {
    0%, 100% { transform: translateX(0); opacity: .45; }
    50% { transform: translateX(385%); opacity: 1; }
}

/* Event density follows its rendered height, so title and time remain the
   priority when a wider time range compresses the calendar. */
#agendaView .agenda-event {
    min-height: 0 !important;
}

#agendaView .agenda-event.is-compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px;
    padding: 3px 5px 3px 7px;
}

#agendaView .agenda-event.is-compact .agenda-event-category,
#agendaView .agenda-event.is-compact .agenda-event-location,
#agendaView .agenda-event.is-micro .agenda-event-category,
#agendaView .agenda-event.is-micro .agenda-event-time,
#agendaView .agenda-event.is-micro .agenda-event-location {
    display: none;
}

#agendaView .agenda-event.is-compact .agenda-event-title {
    min-width: 0;
    -webkit-line-clamp: 1;
    font-size: 10px;
    white-space: nowrap;
}

#agendaView .agenda-event.is-compact .agenda-event-time {
    min-width: 0;
    color: color-mix(in srgb, var(--text-primary, #f5f4ef) 76%, var(--text-secondary, #aaa69d));
    font-size: 8.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#agendaView .agenda-event.is-micro {
    display: block;
    padding: 1px 3px 1px 5px;
}

#agendaView .agenda-event.is-micro .agenda-event-title {
    display: block;
    overflow: hidden;
    font-size: 8.5px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The notes heading is now plain language, without an unexplained symbol. */
#agendaView .agenda-context-notes-label {
    display: block;
    letter-spacing: 0;
}

#agendaView .agenda-view-scroll {
    padding-bottom: 154px;
}

@media (max-width: 1100px) {
    #agendaView .agenda-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    #agendaView .agenda-agent-composer.chat-input-area {
        right: calc(max(var(--agenda-content-gutter), (100% - var(--agenda-content-max)) / 2) + var(--agenda-panel-padding));
    }
}

@media (max-width: 768px) {
    #agendaView {
        --agenda-time-rail-width: 48px;
        --agenda-day-min-width: clamp(30px, calc((100vw - 105px) / 7), 68px);
    }

    #agendaView .agenda-view-scroll {
        padding-bottom: calc(154px + var(--mobile-safe-bottom, 0px));
    }

    #agendaView .agenda-calendar {
        overflow-x: hidden;
    }

    #agendaView .agenda-calendar > .agenda-day-heading,
    #agendaView .agenda-calendar > .agenda-day-column {
        min-width: 0;
    }

    #agendaView .agenda-time-label {
        right: 5px;
        font-size: 9px;
    }

    #agendaView .agenda-day-heading span {
        font-size: 9px;
        letter-spacing: 0;
    }

    #agendaView .agenda-day-heading small {
        display: none;
    }

    #agendaView .agenda-event {
        gap: 2px;
        padding: 4px 3px 4px 5px;
        border-left-width: 2px;
    }

    #agendaView .agenda-event-title {
        font-size: 9px;
    }

    #agendaView .agenda-event-time,
    #agendaView .agenda-event-location {
        font-size: 8px;
    }

    #agendaView .agenda-agent-composer.chat-input-area {
        right: 12px !important;
        bottom: calc(12px + var(--mobile-safe-bottom, 0px)) !important;
        left: 12px !important;
        width: auto !important;
        max-width: none;
        min-height: 54px !important;
        padding: 7px 8px !important;
        gap: 4px !important;
        transform: none !important;
    }

    #agendaView .agenda-agent-composer :where(.attach-btn, .voice-btn, .send-btn) {
        flex: 0 0 42px !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }

    #agendaView .agenda-agent-composer #agendaAgentInput {
        min-height: 38px !important;
        padding: 8px 4px !important;
        font-size: 16px;
        line-height: 1.35 !important;
    }

    #agendaView .agenda-agent-companion {
        right: 16px;
        bottom: calc(140px + var(--mobile-safe-bottom, 0px));
    }

    #agendaView .agenda-agent-undo-toast {
        right: 12px;
        bottom: calc(132px + var(--mobile-safe-bottom, 0px));
        left: 12px;
    }
}

/* Study overview: a readable learning workspace alongside the calendar. */
#agendaView [data-personal-os-view]:not([data-personal-os-view="overview"]):not([data-personal-os-view="calendar"]),
#agendaView [data-personal-os-panel]:not([data-personal-os-panel="overview"]):not([data-personal-os-panel="calendar"]) {
    display: none !important;
}

#agendaView .personal-os-view-nav button { font-size: 15px; padding: 10px 18px; }
#agendaView .agenda-study-overview { gap: 22px; font-size: 16px; line-height: 1.55; }
#agendaView .agenda-study-hero { align-items: center; padding: 12px 2px 6px; }
#agendaView .agenda-study-hero h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.16; margin: 7px 0 12px; }
#agendaView .agenda-study-hero p { max-width: 720px; font-size: 16px; }
#agendaView .agenda-study-overview .agenda-panel-kicker { font-size: 12px; letter-spacing: .09em; }
#agendaView .agenda-study-surface { min-width: 0; padding: 26px; border: 1px solid var(--agenda-soft-line); border-radius: 16px; background: var(--agenda-surface-strong); }
#agendaView .agenda-study-section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
#agendaView .agenda-study-section-header h3 { margin: 4px 0 0; color: var(--text-primary); font-size: 22px; line-height: 1.3; letter-spacing: -.02em; }
#agendaView .agenda-study-section-header .personal-os-text-button { flex-shrink: 0; font-size: 14px; }
#agendaView .agenda-study-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
#agendaView .agenda-study-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
#agendaView .agenda-study-stats:empty { display: none; }
#agendaView .agenda-study-stat { min-width: 0; padding: 20px 24px; border-radius: 14px; border: 1px solid var(--agenda-soft-line); background: var(--agenda-surface); }
#agendaView .agenda-study-stat strong { display: block; font-size: 28px; line-height: 1.2; color: var(--text-primary); }
#agendaView .agenda-study-stat span { display: block; margin-top: 7px; color: var(--text-secondary); font-size: 14px; }
#agendaView .agenda-study-badge { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 7px; color: var(--text-secondary); background: var(--agenda-surface); font-size: 12px; line-height: 1.5; white-space: nowrap; }
#agendaView .agenda-study-empty { padding: 8px 0 14px; color: var(--text-secondary); }
#agendaView .agenda-study-empty strong { display: block; color: var(--text-primary); font-size: 17px; font-weight: 600; }
#agendaView .agenda-study-empty p { max-width: 680px; margin: 9px 0 0; font-size: 15px; line-height: 1.65; }
#agendaView .agenda-study-prompts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 20px; border-top: 1px solid var(--agenda-soft-line); }
#agendaView .agenda-study-prompts button { display: flex; align-items: center; gap: 18px; padding: 11px 14px; border: 1px solid var(--agenda-soft-line); border-radius: 9px; background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
#agendaView .agenda-study-prompts button span { color: var(--text-secondary); }
#agendaView .agenda-study-prompts button:hover { background: var(--agenda-surface); }
#agendaView .agenda-study-prompts button:focus-visible,
#agendaView .agenda-study-action:focus-visible { outline: 2px solid var(--agenda-accent); outline-offset: 3px; }
#agendaView .agenda-study-table-wrap { overflow-x: auto; border: 1px solid var(--agenda-soft-line); border-radius: 10px; margin: 16px 0; }
#agendaView .agenda-study-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 15px; }
#agendaView .agenda-study-table th { padding: 13px 16px; font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--agenda-surface); white-space: nowrap; }
#agendaView .agenda-study-table td { padding: 16px; border-top: 1px solid var(--agenda-soft-line); color: var(--text-primary); vertical-align: top; }
#agendaView .agenda-study-table td small { display: block; margin-top: 5px; color: var(--text-secondary); font-size: 13px; }
#agendaView .agenda-study-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
#agendaView .agenda-study-action { padding: 11px 17px; min-height: 44px; border: 1px solid var(--agenda-soft-line); border-radius: 9px; color: var(--text-primary); background: var(--agenda-surface); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
#agendaView .agenda-study-action.is-primary { border-color: transparent; background: var(--text-primary); color: var(--agenda-surface-strong); }
#agendaView .agenda-study-action:disabled { opacity: .5; cursor: default; }
#agendaView .agenda-study-list { display: grid; gap: 12px; }
#agendaView .agenda-study-row,
#agendaView .agenda-study-session { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--agenda-soft-line); }
#agendaView .agenda-study-row:last-child,
#agendaView .agenda-study-session:last-child { border-bottom: 0; }
#agendaView .agenda-study-row strong,
#agendaView .agenda-study-session strong { display: block; color: var(--text-primary); font-size: 16px; }
#agendaView .agenda-study-row p,
#agendaView .agenda-study-session p { margin: 5px 0 0; color: var(--text-secondary); font-size: 14px; }
#agendaView .agenda-study-meta,
#agendaView .agenda-study-note { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
#agendaView .agenda-study-plan h4 { margin: 8px 0; font-size: 19px; color: var(--text-primary); }
#agendaView .agenda-study-plan input,
#agendaView .agenda-study-plan select { max-width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid var(--agenda-soft-line); border-radius: 7px; background: var(--agenda-surface); color: var(--text-primary); font: inherit; font-size: 14px; }

/* Match Chat's two-row input layout with a fixed rectangular shape. */
#agendaView .agenda-agent-composer.chat-input-area,
#agendaView .agenda-agent-composer.chat-input-area:hover,
#agendaView .agenda-agent-composer.chat-input-area:focus-within {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 38px 40px !important;
    grid-template-rows: auto 40px !important;
    align-items: stretch !important;
    column-gap: 8px !important;
    row-gap: 2px !important;
    min-height: 120px !important;
    padding: 10px 12px 8px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    corner-shape: round !important;
    background: var(--logicum-composer-surface, var(--input-bg)) !important;
    box-shadow: none !important;
}
#agendaView .agenda-agent-composer #agendaAgentInput {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: var(--logicum-chat-input-height, 56px) !important;
    min-height: 56px !important;
    max-height: 180px !important;
    padding: 4px 8px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}
#agendaView .agenda-agent-composer :where(.attach-btn, .voice-btn, .send-btn) {
    grid-row: 2 !important;
    align-self: center !important;
    justify-self: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
}
#agendaView .agenda-agent-composer .attach-btn { grid-column: 1 !important; }
#agendaView .agenda-agent-composer .voice-btn { grid-column: 3 !important; }
#agendaView .agenda-agent-composer .send-btn { grid-column: 4 !important; width: 40px !important; height: 40px !important; }
#agendaView .agenda-agent-companion { bottom: 176px; }
#agendaView .agenda-agent-undo-toast { bottom: 160px; }
#agendaView .agenda-view-scroll { padding-bottom: 190px; }

@media (min-width: 769px) {
    #agendaView .agenda-event-title,
    #agendaView .agenda-event.is-compact .agenda-event-title { font-size: 13px; }
    #agendaView .agenda-event-time,
    #agendaView .agenda-event.is-compact .agenda-event-time,
    #agendaView .agenda-event-location { font-size: 11px; }
    #agendaView .agenda-day-name,
    #agendaView .agenda-time-label { font-size: 12px; }
}
@media (max-width: 768px) {
    #agendaView .agenda-study-overview { gap: 16px; }
    #agendaView .agenda-study-hero { align-items: flex-start; }
    #agendaView .agenda-study-hero h2 { font-size: 29px; }
    #agendaView .agenda-study-hero p { font-size: 15px; }
    #agendaView .agenda-study-hero .personal-os-quiet-button span { display: none; }
    #agendaView .agenda-study-grid { grid-template-columns: 1fr; gap: 16px; }
    #agendaView .agenda-study-surface { padding: 20px; }
    #agendaView .agenda-study-stats { gap: 8px; }
    #agendaView .agenda-study-stat { padding: 14px 12px; }
    #agendaView .agenda-study-stat strong { font-size: 23px; }
    #agendaView .agenda-study-stat span { font-size: 12px; }
    #agendaView .agenda-study-section-header { flex-wrap: wrap; gap: 10px; }
    #agendaView .agenda-study-row,
    #agendaView .agenda-study-session { flex-wrap: wrap; }
    #agendaView .agenda-study-prompts button { width: 100%; justify-content: space-between; }
    #agendaView .agenda-agent-companion { bottom: calc(176px + var(--mobile-safe-bottom, 0px)); }
    #agendaView .agenda-agent-undo-toast { bottom: calc(160px + var(--mobile-safe-bottom, 0px)); }
    #agendaView .agenda-view-scroll { padding-bottom: calc(190px + var(--mobile-safe-bottom, 0px)); }
}
#agendaView .agenda-study-controls { display: flex; flex-wrap: wrap; gap: 16px; margin: 20px 0; }
#agendaView .agenda-study-field { display: grid; gap: 8px; flex: 1 1 180px; }
#agendaView .agenda-study-field span, #agendaView .agenda-study-weekdays legend { color: var(--text-secondary); font-size: 14px; }
#agendaView .agenda-study-weekdays { display: flex; flex-wrap: wrap; gap: 12px; border: 0; padding: 10px 0; margin: 0; }
#agendaView .agenda-study-weekdays label { display: flex; gap: 7px; align-items: center; font-size: 15px; cursor: pointer; }
#agendaView .agenda-study-weekdays input { min-height: 18px; width: 18px; accent-color: var(--text-secondary); }
#agendaView .agenda-study-table input { width: 100%; box-sizing: border-box; min-width: 100px; }
#agendaView .agenda-study-table input[type=number] { width: 78px; min-width: 78px; }
#agendaView .agenda-study-table td:nth-child(2) { width: 40%; }
#agendaView .agenda-study-task { padding: 18px 0; border-bottom: 1px solid var(--agenda-soft-line); }
#agendaView .agenda-study-task-copy strong { display: block; font-size: 17px; }
#agendaView .agenda-study-task-copy span { display: block; margin-top: 6px; font-size: 14px; color: var(--text-secondary); }
#agendaView .agenda-study-task.is-complete strong { color: var(--text-secondary); }
#agendaView .agenda-study-subtitle, #agendaView .agenda-study-status { color: var(--text-secondary); font-size: 15px; line-height: 1.6; }
#agendaView .agenda-study-status:empty { display: none; }
