/**
 * Konsul overrides on top of SLDS.
 * Keep this file small — SLDS owns the design system. Only brand chrome
 * and page scaffolding that SLDS doesn't provide belongs here.
 */

body {
    background: #f3f3f3;
    background: var(--slds-g-color-neutral-base-95, #f3f3f3);
    /* The SLDS global header is position:fixed — offset everything below it */
    padding-top: 50px;
}

/* Full-bleed content: edge-to-edge with a small outer margin only */
.kn-main {
    padding: 0.75rem 1rem;
    max-width: none;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* Brand wordmark in the global header (replaces the Salesforce logo slot) */
.kn-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.kn-logo:hover { text-decoration: none; }
.kn-logo-mark {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0176d3, #04c0eb);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
}
.kn-logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: #032d60;
}

/* Initials avatar */
.kn-avatar {
    background: #0176d3;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

/* Stat figures on the home cards */
.kn-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #032d60;
}

/* ==========================================================================
   Lightning-style page layout editor (Setup → Object Manager)
   ========================================================================== */

.kn-layout-editor {
    /* Flush to the kn-main edges for a true builder canvas */
    margin: -0.75rem -1rem;
    min-height: calc(100vh - 50px - 40px); /* header + context bar approx */
    display: flex;
    flex-direction: column;
    background: #eef1f6;
    background: var(--slds-g-color-neutral-base-95, #eef1f6);
}

.kn-layout-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: #fff;
    border-bottom: 1px solid #c9c9c9;
    border-bottom-color: var(--slds-g-color-border-base-1, #c9c9c9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.kn-layout-panes {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(200px, 240px) 1fr minmax(220px, 280px);
    gap: 0;
    min-height: 0;
    border-top: 0;
}

.kn-layout-palette,
.kn-layout-canvas,
.kn-layout-preview {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
}

.kn-layout-palette {
    border-right: 1px solid #c9c9c9;
    border-right-color: var(--slds-g-color-border-base-1, #c9c9c9);
}

.kn-layout-preview {
    border-left: 1px solid #c9c9c9;
    border-left-color: var(--slds-g-color-border-base-1, #c9c9c9);
    background: #fafaf9;
}

.kn-layout-pane-header {
    flex: 0 0 auto;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e5e5e5;
    background: #f3f3f3;
    background: var(--slds-g-color-neutral-base-95, #f3f3f3);
}

.kn-layout-pane-header_canvas {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.kn-layout-palette-list,
.kn-layout-canvas-body,
.kn-layout-preview-body {
    flex: 1;
    overflow: auto;
    padding: 0.75rem;
}

/* ---- Palette chips ---- */
.kn-field-chip {
    display: grid;
    grid-template-columns: 18px 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.45rem;
    row-gap: 0.05rem;
    align-items: center;
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.4rem;
    border: 1px solid #c9c9c9;
    border-radius: 0.25rem;
    background: #fff;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.12s, border-color 0.12s, transform 0.12s;
}
.kn-field-chip:hover {
    border-color: #0176d3;
    box-shadow: 0 1px 4px rgba(1, 118, 211, 0.18);
}
.kn-field-chip.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}
.kn-field-chip__kind {
    grid-row: 1 / span 2;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: #eef4ff;
    position: relative;
}
.kn-field-chip__kind::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 1px;
    background: #0176d3;
}
.kn-field-chip__kind[data-kind="number"]::after { background: #2e844a; }
.kn-field-chip__kind[data-kind="boolean"]::after { background: #8b5cf6; }
.kn-field-chip__kind[data-kind="date"]::after { background: #dd7a01; }
.kn-field-chip__kind[data-kind="relation"]::after { background: #0b827c; }
.kn-field-chip__kind[data-kind="long"]::after { background: #5c5c5c; border-radius: 0; height: 4px; top: 7px; bottom: auto; }

.kn-field-chip__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #181818;
    line-height: 1.2;
}
.kn-field-chip__api {
    font-size: 0.6875rem;
    color: #706e6b;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- Canvas sections ---- */
.kn-layout-section {
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 0.25rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.kn-layout-section.is-dragging { opacity: 0.5; }
.kn-layout-section.is-section-over {
    outline: 2px solid #0176d3;
    outline-offset: 2px;
}

.kn-layout-section__header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0.55rem;
    background: linear-gradient(180deg, #f7f9fb, #eef2f7);
    border-bottom: 1px solid #e5e5e5;
}
.kn-layout-section__grip {
    cursor: grab;
    color: #706e6b;
    font-size: 0.75rem;
    letter-spacing: -1px;
    padding: 0.25rem;
    user-select: none;
}
.kn-layout-section__title {
    font-weight: 600;
    height: 2rem;
}
.kn-layout-section__remove {
    width: 1.75rem;
    height: 1.75rem;
    line-height: 1;
    font-size: 1.1rem;
    color: #706e6b;
}

.kn-layout-section__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.65rem;
    min-height: 3.5rem;
    transition: background 0.12s, box-shadow 0.12s;
}
.kn-layout-section__grid.is-over {
    background: #eef4ff;
    box-shadow: inset 0 0 0 2px #0176d3;
}
.kn-layout-section__empty {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 3rem;
    border: 1px dashed #b0adab;
    border-radius: 0.25rem;
    color: #706e6b;
    font-size: 0.8125rem;
    background: #fafaf9;
}

/* ---- Field tiles on canvas ---- */
.kn-field-tile {
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    gap: 0.35rem;
    align-items: center;
    padding: 0.4rem 0.45rem;
    border: 1px solid #c9c9c9;
    border-radius: 0.25rem;
    background: #fff;
    cursor: grab;
    user-select: none;
    min-height: 2.5rem;
}
.kn-field-tile_span2 {
    grid-column: 1 / -1;
    border-color: #0176d3;
    background: #f7fbff;
}
.kn-field-tile__span {
    border: 0;
    background: transparent;
    color: #0176d3;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.25rem;
    border-radius: 0.2rem;
}
.kn-field-tile__span:hover {
    background: #eef4ff;
}
.kn-field__static_long {
    white-space: pre-wrap;
}
.kn-field-tile:hover {
    border-color: #0176d3;
}
.kn-field-tile.is-dragging { opacity: 0.4; }
.kn-field-tile.is-drop-target {
    border-color: #0176d3;
    box-shadow: 0 0 0 2px rgba(1, 118, 211, 0.25);
}
.kn-field-tile__grip {
    color: #b0adab;
    font-size: 0.7rem;
    letter-spacing: -1px;
}
.kn-field-tile__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.kn-field-tile__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #181818;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kn-field-tile__api {
    font-size: 0.65rem;
    color: #706e6b;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.kn-field-tile__remove {
    border: 0;
    background: transparent;
    color: #706e6b;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
}
.kn-field-tile__remove:hover {
    background: #f3f3f3;
    color: #ba0517;
}

.kn-layout-end-drop {
    margin: 0.25rem 0 1rem;
    padding: 0.85rem;
    text-align: center;
    border: 1px dashed #b0adab;
    border-radius: 0.25rem;
    color: #706e6b;
    font-size: 0.8125rem;
    background: #fafaf9;
}
.kn-layout-end-drop.is-over {
    border-color: #0176d3;
    background: #eef4ff;
    color: #0176d3;
}

/* ---- Preview pane ---- */
.kn-preview-section {
    margin-bottom: 1rem;
}
.kn-preview-section__title {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
}
.kn-preview-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.75rem;
}
.kn-preview-field {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.kn-preview-field_span2 {
    grid-column: 1 / -1;
}
.kn-preview-field__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #706e6b;
}
.kn-preview-field__value {
    font-size: 0.8125rem;
    color: #181818;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 0.15rem;
    min-height: 1.25rem;
}

@media (max-width: 960px) {
    .kn-layout-panes {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    .kn-layout-palette,
    .kn-layout-preview {
        max-height: 220px;
        border: 0;
        border-bottom: 1px solid #c9c9c9;
    }
    .kn-layout-preview {
        border-bottom: 0;
        border-top: 1px solid #c9c9c9;
    }
}

/* ==========================================================================
   List view picker (object home title)
   ========================================================================== */

.kn-listview-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
    margin: 0;
}
.kn-listview-heading__object {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #444;
}

.kn-listview-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.kn-listview-picker__trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    height: auto !important;
    min-height: 2rem;
    padding: 0.15rem 0.5rem 0.15rem 0.35rem !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    line-height: 1.2;
}
.kn-listview-picker__trigger:hover,
.kn-listview-picker.is-open .kn-listview-picker__trigger {
    border-color: #c9c9c9 !important;
    background: #fff !important;
}
.kn-listview-picker__label {
    font-size: 1.125rem;
    font-weight: 700;
    color: #181818;
    max-width: 18rem;
}
.kn-listview-picker__chevron {
    flex-shrink: 0;
}
.kn-listview-picker__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    min-width: 16rem;
    max-width: 22rem;
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 0.25rem 0;
}
.kn-listview-picker__menu .slds-dropdown__item > a,
.kn-listview-picker__menubtn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: #181818;
    text-decoration: none;
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
}
.kn-listview-picker__menu .slds-dropdown__item > a:hover,
.kn-listview-picker__menubtn:hover {
    background: #f3f3f3;
}
.kn-listview-picker__menu .slds-is-selected > a {
    font-weight: 600;
    background: #eef4ff;
}
.kn-listview-picker__menubtn_danger {
    color: #ba0517;
}
.kn-listview-picker__form {
    margin: 0;
}
.kn-filter-rule .slds-col {
    min-width: 0;
}

/* ==========================================================================
   Lightning App Builder — page templates + regions
   ========================================================================== */

.kn-ab-mode.is-active {
    background: #0176d3 !important;
    border-color: #0176d3 !important;
    color: #fff !important;
}

.kn-ab-template-bar {
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #c9c9c9;
}
.kn-ab-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.kn-ab-template-card {
    width: 7.5rem;
    padding: 0.45rem;
    border: 2px solid #c9c9c9;
    border-radius: 0.35rem;
    background: #fafaf9;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.kn-ab-template-card:hover {
    border-color: #0176d3;
}
.kn-ab-template-card.is-selected {
    border-color: #0176d3;
    box-shadow: 0 0 0 1px #0176d3;
    background: #eef4ff;
}
.kn-ab-template-card__wire {
    display: flex;
    gap: 3px;
    height: 2.25rem;
    margin-bottom: 0.35rem;
}
.kn-ab-template-card__wire.is-tabs {
    flex-direction: column;
}
.kn-ab-template-card__wire.is-tabs .kn-ab-template-card__col {
    flex: 1 !important;
    height: 0.55rem;
}
.kn-ab-template-card__col {
    background: #b0c4de;
    border-radius: 2px;
    min-width: 0;
}
.kn-ab-template-card.is-selected .kn-ab-template-card__col {
    background: #0176d3;
}
.kn-ab-template-card__label {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
    color: #181818;
}

.kn-ab-region-row {
    display: grid;
    gap: 0.75rem;
    min-height: 16rem;
}
.kn-ab-region {
    display: flex;
    flex-direction: column;
    border: 1px solid #c9c9c9;
    border-radius: 0.25rem;
    background: #fafaf9;
    min-height: 12rem;
}
.kn-ab-region__header {
    padding: 0.4rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #444;
    background: #eef2f7;
    border-bottom: 1px solid #e5e5e5;
}
.kn-ab-region__body {
    flex: 1;
    padding: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 8rem;
    transition: background 0.12s, box-shadow 0.12s;
}
.kn-ab-region__body.is-over {
    background: #eef4ff;
    box-shadow: inset 0 0 0 2px #0176d3;
}
.kn-ab-region__empty {
    flex: 1;
    display: grid;
    place-items: center;
    border: 1px dashed #b0adab;
    border-radius: 0.25rem;
    color: #706e6b;
    font-size: 0.8125rem;
    min-height: 5rem;
}
.kn-ab-comp-tile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.35rem;
    align-items: center;
    padding: 0.45rem 0.5rem;
    border: 1px solid #c9c9c9;
    border-radius: 0.25rem;
    background: #fff;
    cursor: grab;
}
.kn-ab-comp-tile:hover {
    border-color: #0176d3;
}
.kn-ab-comp-tile.is-dragging {
    opacity: 0.4;
}
.kn-field-chip.is-placed {
    opacity: 0.55;
    cursor: default;
}

/* Wireframe preview */
.kn-ab-wire-header {
    padding: 0.5rem;
    background: #e5e5e5;
    border-radius: 0.25rem 0.25rem 0 0;
    font-size: 0.6875rem;
    font-weight: 600;
    text-align: center;
    color: #444;
}
.kn-ab-wire-body {
    display: grid;
    gap: 0.35rem;
    min-height: 10rem;
    border: 1px solid #c9c9c9;
    border-top: 0;
    border-radius: 0 0 0.25rem 0.25rem;
    padding: 0.35rem;
    background: #fff;
}
.kn-ab-wire-region {
    background: #f3f3f3;
    border: 1px dashed #b0adab;
    border-radius: 0.2rem;
    padding: 0.35rem;
    min-height: 5rem;
}
.kn-ab-wire-region__label {
    font-size: 0.625rem;
    text-transform: uppercase;
    color: #706e6b;
    margin-bottom: 0.25rem;
}
.kn-ab-wire-comp {
    background: #0176d3;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.35rem 0.4rem;
    border-radius: 0.15rem;
    margin-bottom: 0.25rem;
}
.kn-ab-wire-empty {
    color: #b0adab;
    font-size: 0.75rem;
    text-align: center;
    padding: 1rem 0;
}

/* Record page multi-region grids */
.kn-record-grid {
    display: grid;
    gap: 0.75rem;
    align-items: start;
}
.kn-record-grid_full {
    grid-template-columns: 1fr;
}
.kn-record-grid_equal_two {
    grid-template-columns: 1fr 1fr;
}
.kn-record-grid_two_thirds_one_third {
    grid-template-columns: 2fr 1fr;
}
.kn-record-grid_one_third_two_thirds {
    grid-template-columns: 1fr 2fr;
}
.kn-record-grid_three_equal {
    grid-template-columns: 1fr 1fr 1fr;
}
.kn-record-region__empty {
    border: 1px dashed #c9c9c9;
    border-radius: 0.25rem;
    background: #fafaf9;
}
.kn-component {
    margin-bottom: 0.75rem;
}
.kn-component:last-child {
    margin-bottom: 0;
}

/* Spacers */
.kn-spacer_small { height: 0.75rem; }
.kn-spacer_medium { height: 1.5rem; }
.kn-spacer_large { height: 2.5rem; }

/* Accordion polish */
.kn-component_accordion {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}
.kn-component_accordion .slds-accordion__section {
    border: 1px solid #c9c9c9;
    border-radius: 0.25rem;
    margin-bottom: 0.35rem;
    background: #fff;
}
.kn-component_accordion .slds-accordion__summary {
    padding: 0.5rem 0.65rem;
    background: #f3f3f3;
}
.kn-component_accordion .slds-accordion__summary-action {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    font-weight: 600;
    color: #181818;
    text-align: left;
}
.kn-component_accordion .slds-accordion__content {
    padding: 0.65rem;
}
.kn-component_accordion .slds-is-open .slds-accordion__summary-action-icon {
    transform: rotate(180deg);
}

/* App builder props + palette categories */
.kn-ab-palette-cat {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #706e6b;
    margin: 0.65rem 0 0.35rem;
}
.kn-ab-palette-cat:first-child {
    margin-top: 0;
}
.kn-ab-props {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid #c9c9c9;
    border-radius: 0.25rem;
    background: #fff;
}
.kn-ab-comp-tile.is-selected {
    border-color: #0176d3;
    box-shadow: 0 0 0 2px rgba(1, 118, 211, 0.2);
    background: #f7fbff;
}
.kn-ab-panel-editor {
    background: #fafaf9;
}
.kn-badge-x {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.85em;
    padding: 0 0.15rem;
}
.kn-rich-text-body {
    white-space: pre-wrap;
}

/* Companies House modal */
.kn-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8vh;
}
.kn-ch-modal {
    max-width: 40rem;
    width: 100%;
}
.kn-ch-results {
    max-height: 50vh;
    overflow-y: auto;
}
.kn-ch-result {
    background: var(--slds-g-color-neutral-base-100, #fff);
}
.kn-ch-result:hover {
    background: var(--slds-g-color-neutral-base-95, #f3f3f3);
}
.slds-text-color_error {
    color: #ba0517;
}

/* Meeting workspace panels */
.kn-prose {
    font-size: 0.875rem;
    line-height: 1.55;
    color: #181818;
}
.kn-prose > :first-child {
    margin-top: 0;
}
.kn-prose > :last-child {
    margin-bottom: 0;
}
.kn-prose h1,
.kn-prose h2,
.kn-prose h3,
.kn-prose h4,
.kn-prose h5,
.kn-prose h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #181818;
    margin: 1.1rem 0 0.4rem;
}
.kn-prose h1 { font-size: 1.25rem; }
.kn-prose h2 { font-size: 1.1rem; }
.kn-prose h3 { font-size: 1rem; }
.kn-prose h4 { font-size: 0.9375rem; }
.kn-prose p {
    margin: 0.45rem 0;
}
.kn-prose ul,
.kn-prose ol {
    margin: 0.4rem 0 0.65rem;
    padding-left: 1.35rem;
}
.kn-prose li {
    margin: 0.25rem 0;
}
.kn-prose li > p {
    margin: 0.15rem 0;
}
.kn-prose a {
    color: #0176d3;
    text-decoration: none;
    word-break: break-word;
}
.kn-prose a:hover {
    text-decoration: underline;
}
.kn-prose strong {
    font-weight: 700;
}
.kn-prose em {
    font-style: italic;
}
.kn-prose code {
    font-size: 0.85em;
    background: #f3f3f3;
    padding: 0.05rem 0.3rem;
    border-radius: 0.2rem;
}
.kn-prose pre {
    background: #f3f3f3;
    padding: 0.65rem 0.75rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    font-size: 0.8125rem;
}
.kn-prose blockquote {
    margin: 0.6rem 0;
    padding: 0.2rem 0 0.2rem 0.75rem;
    border-left: 3px solid #c9c7c5;
    color: #444;
}
.kn-prose hr {
    border: 0;
    border-top: 1px solid #e5e5e5;
    margin: 0.9rem 0;
}
.kn-transcript {
    max-height: 32rem;
    overflow-y: auto;
    font-size: 0.8125rem;
    line-height: 1.5;
    border: 1px solid #e5e5e5;
    border-radius: 0.25rem;
    background: #fafaf9;
    padding: 0.5rem 0.65rem;
}
.kn-transcript__line {
    display: grid;
    grid-template-columns: 4.75rem minmax(5rem, max-content) 1fr;
    gap: 0.4rem 0.65rem;
    padding: 0.35rem 0.15rem;
    border-bottom: 1px solid #f0f0f0;
    align-items: baseline;
}
.kn-transcript__line:last-child {
    border-bottom: 0;
}
.kn-transcript__ts {
    color: #706e6b;
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
}
.kn-transcript__speaker {
    font-weight: 700;
    color: #0176d3;
    white-space: nowrap;
}
.kn-transcript__text {
    color: #181818;
    min-width: 0;
}
.kn-component_meeting-summary .slds-card__body_inner,
.kn-component_meeting-transcript .slds-card__body_inner {
    padding-top: 0.5rem;
}

@media (max-width: 900px) {
    .kn-record-grid_equal_two,
    .kn-record-grid_two_thirds_one_third,
    .kn-record-grid_one_third_two_thirds,
    .kn-record-grid_three_equal {
        grid-template-columns: 1fr;
    }
}

/* Setup — Salesforce Classic-style expandable Objects tree */
.kn-setup-nav-col {
    min-width: 14rem;
}
.kn-setup-section-link {
    color: inherit;
    text-decoration: none;
}
.kn-setup-section-link:hover,
.kn-setup-section-link.is-active {
    color: #0176d3;
}
.kn-setup-object-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}
.kn-setup-object {
    margin: 0;
}
.kn-setup-object details {
    margin: 0;
}
.kn-setup-object__summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #181818;
    user-select: none;
}
.kn-setup-object__summary::-webkit-details-marker {
    display: none;
}
.kn-setup-object__summary:hover {
    background: #f3f3f3;
}
.kn-setup-object__summary.is-current {
    color: #0176d3;
}
.kn-setup-object__chevron {
    width: 0.45rem;
    height: 0.45rem;
    border-right: 1.5px solid #706e6b;
    border-bottom: 1.5px solid #706e6b;
    transform: rotate(-45deg);
    transition: transform 0.12s ease;
    flex-shrink: 0;
    margin-right: 0.15rem;
}
.kn-setup-object details[open] > .kn-setup-object__summary .kn-setup-object__chevron {
    transform: rotate(45deg);
    margin-top: -0.1rem;
}
.kn-setup-object__name {
    color: inherit;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}
.kn-setup-object__name:hover {
    text-decoration: underline;
}
.kn-setup-object__children {
    list-style: none;
    margin: 0;
    padding: 0 0 0.25rem 0;
}
.kn-setup-object__children .slds-nav-vertical__action {
    padding-left: 1.75rem;
    font-size: 0.8125rem;
}
.kn-setup-tile {
    height: 100%;
}

/* ==========================================================================
   Platform activity log drawer (global header console icon)
   ========================================================================== */

.kn-activity-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 7, 7, 0.35);
    z-index: 9000;
}
.kn-activity-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(32rem, 92vw);
    height: 100vh;
    background: #16325c;
    color: #e5e5e5;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.28);
    z-index: 9001;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.2s ease;
}
.kn-activity-drawer.is-open {
    transform: translateX(0);
}
.kn-activity-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}
.kn-activity-drawer__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}
.kn-activity-drawer__subtitle {
    font-size: 0.7rem;
    color: #b0c4de;
    margin-top: 0.15rem;
}
.kn-activity-drawer__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.kn-activity-drawer__actions .slds-button__icon {
    fill: #fff;
}
.kn-activity-filter {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 0.25rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    max-width: 9rem;
}
.kn-activity-pane {
    flex: 1;
    margin: 0;
    padding: 0.65rem 1rem 1.25rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.55;
    background: #0b1f3a;
    color: #d8e6f7;
}
.kn-log-error { color: #fe8f7d; }
.kn-log-warn { color: #ffb75d; }
.kn-log-empty { color: #8ba3c1; font-style: italic; }

/* ==========================================================================
   GitHub lists — clip long descriptions (repos + projects)
   ========================================================================== */

.kn-gh-repos-table,
.kn-gh-list-table {
    table-layout: fixed;
    width: 100%;
}
.kn-gh-repo-cell,
.kn-gh-clip-cell {
    max-width: 0; /* forces table cell to honor width + ellipsis */
    vertical-align: top;
}
.kn-gh-repo-desc,
.kn-gh-clip-desc {
    max-width: 100%;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   Home dashboard (Gridstack widgets on /)
   ========================================================================== */

#kn-home-root { position: relative; }

.kn-home-builder {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border: 1px solid var(--slds-g-color-border-base-1, #e5e5e5);
}
.kn-home-builder[hidden],
.kn-home-addmenu[hidden],
#kn-home-edit[hidden] { display: none !important; }

.kn-home-builder__left { position: relative; }
.kn-home-builder__right { margin-left: auto; display: flex; gap: 0.5rem; }
.kn-home-status {
    font-size: 0.8125rem;
    color: #706e6b;
    color: var(--slds-g-color-neutral-base-30, #706e6b);
}

.kn-home-addmenu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    min-width: 14rem;
    padding: 0.35rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.kn-home-addopt {
    text-align: left;
    padding: 0.5rem 0.65rem;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: #181818;
    font-size: 0.8125rem;
    cursor: pointer;
}
.kn-home-addopt:hover { background: #eef4ff; }

/* Do NOT set inset:0 — Gridstack applies margin as inset on
   .grid-stack-item-content; zeroing it collapses every gap. */
#kn-home-grid .grid-stack-item-content {
    overflow: hidden;
}
#kn-home-grid.is-editing .grid-stack-item-content {
    outline: 1px dashed #c9c7c5;
    outline-offset: -1px;
}

.kn-home-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e5e5;
    border: 1px solid var(--slds-g-color-border-base-1, #e5e5e5);
    border-radius: 0.625rem;
    /* Soft lift so cards read off the page background */
    box-shadow:
        0 1px 2px rgba(3, 45, 96, 0.04),
        0 4px 12px rgba(3, 45, 96, 0.08),
        0 12px 28px rgba(3, 45, 96, 0.06);
}
.kn-home-card__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    border-bottom: 1px solid var(--slds-g-color-border-base-1, #e5e5e5);
    background: #fafaf9;
}
.kn-home-card__head h3 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #181818;
    letter-spacing: 0.01em;
}
.kn-home-card__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.1rem 1.1rem;
}

.kn-home-drag {
    display: none;
    width: 14px;
    height: 14px;
    cursor: move;
    flex: 0 0 auto;
}
.kn-home-drag::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#706e6b 1px, transparent 1px);
    background-size: 4px 4px;
    opacity: 0.7;
}
#kn-home-grid.is-editing .kn-home-drag { display: block; }

.kn-home-remove {
    display: none;
    margin-left: auto;
    width: 1.4rem;
    height: 1.4rem;
    line-height: 1;
    border: 1px solid #e5e5e5;
    border-radius: 0.35rem;
    background: transparent;
    color: #706e6b;
    cursor: pointer;
    font-size: 0.95rem;
}
#kn-home-grid.is-editing .kn-home-remove { display: inline-flex; align-items: center; justify-content: center; }
.kn-home-remove:hover { background: #fef1ee; color: #ba0517; border-color: #fddde3; }

.kn-home-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}
.kn-home-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.kn-home-stat__value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
    color: #032d60;
}
.kn-home-stat__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #706e6b;
}

.kn-home-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.kn-home-list__item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f3f3f3;
}
.kn-home-list__item:last-child { border-bottom: 0; }
.kn-home-list__link {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.kn-home-list__link:hover .kn-home-list__title { color: #0176d3; }
.kn-home-list__title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #181818;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kn-home-list__meta {
    display: block;
    font-size: 0.75rem;
    color: #706e6b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kn-home-pill {
    flex: 0 0 auto;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    background: #eef4ff;
    color: #0176d3;
}

.kn-home-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 7rem;
    padding-top: 0.5rem;
}
.kn-home-bar-col {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
}
.kn-home-bar {
    width: 100%;
    min-height: 1px;
    background: linear-gradient(180deg, #0176d3, #1b96ff);
    border-radius: 2px 2px 0 0;
    opacity: 0.85;
}
.kn-home-sub {
    font-size: 0.75rem;
    color: #706e6b;
    margin-bottom: 0.25rem;
}

.kn-home-log {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: #3e3e3c;
}

.kn-home-empty {
    font-size: 0.8125rem;
    color: #706e6b;
    font-style: italic;
    padding: 0.5rem 0;
}
.kn-home-warn {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #8c4b02;
    margin-bottom: 0.25rem;
}

/* Project burn chart — one column per month of a retainer, with the monthly
   allowance drawn across. Scaled to the busiest month rather than to the
   allowance, so a client running at six times its allowance still produces a
   readable chart instead of twelve bars pinned to the ceiling. */
.kn-burn {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--slds-g-color-border-base-1, #e5e5e5);
}
.kn-burn:last-child { border-bottom: 0; }
.kn-burn_plain { padding: 0.4rem 0; }
.kn-burn__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.kn-burn__name { font-weight: 600; }
.kn-burn__stat {
  font-size: 0.8125rem;
  color: #514f4d;
  margin: 0.2rem 0 0.4rem;
}
.kn-burn__over {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0 0.35rem;
  border-radius: 0.75rem;
  background: #fef1ee;
  color: #ba0517;
  font-weight: 600;
}
.kn-burn__chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  height: 4.5rem;
  padding-bottom: 0.9rem;
}
/* The allowance. A dashed rule reads as a threshold; a solid one reads as
   an axis, which it is not. */
.kn-burn__line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed #747474;
  margin-bottom: 0.9rem;
  pointer-events: none;
  z-index: 1;
}
.kn-burn__col {
  position: relative;
  flex: 1 1 0;
  min-width: 0.4rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/* Stacked column: the hours the retainer covers at the bottom, the hours
   delivered above the allowance on top. column-reverse puts the first child
   at the base; segment heights are percentages of the busiest month, the
   same scale the column uses, so the parts add up to the whole. */
.kn-burn__stack {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  border-radius: 1px 1px 0 0;
  overflow: hidden;
}
.kn-burn__seg { display: block; width: 100%; min-height: 1px; }
.kn-burn__seg_included { background: #0176d3; }
.kn-burn__seg_extra { background: #ba0517; }
/* A billed month is settled — paler so an unbilled overrun draws the eye. */
.kn-burn__stack.is-billed { opacity: 0.55; }
.kn-burn__col.is-current .kn-burn__stack { outline: 1px solid #181818; outline-offset: 1px; }
.kn-burn__tick {
  position: absolute;
  bottom: -0.9rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.5625rem;
  color: #747474;
  letter-spacing: -0.02em;
}
.kn-burn__col.is-current .kn-burn__tick { color: #181818; font-weight: 700; }

/* ==========================================================================
   Global search (header)
   ========================================================================== */

.kn-gs {
    position: relative;
    width: 100%;
    max-width: 28rem;
}
.kn-gs__hint {
    pointer-events: none;
    font-size: 0.7rem;
    font-weight: 600;
    color: #706e6b;
    right: 0.65rem !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%);
    width: auto !important;
    height: auto !important;
    opacity: 0.75;
}
.kn-gs.is-open .kn-gs__hint { opacity: 0; }
.kn-gs__panel {
    display: none;
    position: absolute;
    z-index: 9000;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: min(70vh, 28rem);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    box-shadow: 0 8px 28px rgba(3, 45, 96, 0.14);
}
.kn-gs.is-open .kn-gs__panel:not([hidden]) {
    display: block;
}
.kn-gs__empty {
    padding: 1rem 1.1rem;
    font-size: 0.8125rem;
    color: #706e6b;
}
.kn-gs__group-label {
    padding: 0.55rem 0.9rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #706e6b;
    background: #fafaf9;
    border-top: 1px solid #f3f3f3;
    position: sticky;
    top: 0;
}
.kn-gs__group:first-child .kn-gs__group-label { border-top: 0; }
.kn-gs__item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.9rem;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
}
.kn-gs__item:hover,
.kn-gs__item.is-active {
    background: #eef4ff;
    border-left-color: #0176d3;
    text-decoration: none;
}
.kn-gs__icon {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.3rem;
    margin-top: 0.1rem;
    background: #eef1f6;
}
.kn-gs__icon--company { background: #cfe9fe; }
.kn-gs__icon--contact { background: #d8f5e8; }
.kn-gs__icon--project { background: #f5d0fe; }
.kn-gs__icon--ticket { background: #ffe0a3; }
.kn-gs__icon--quote { background: #d4edda; }
.kn-gs__icon--meeting { background: #e0d4fc; }
.kn-gs__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.kn-gs__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #181818;
    line-height: 1.3;
}
.kn-gs__title mark {
    background: #fff3b0;
    color: inherit;
    padding: 0 0.1em;
    border-radius: 0.1rem;
}
.kn-gs__sub {
    font-size: 0.75rem;
    color: #706e6b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cashflow — a stacked column per month, from settled at the bottom to least
   certain on top. Bucketed by when the money is expected, never by when the
   work happened: an invoice sits in the month it falls due, an uninvoiced
   contract month in its own period. */
.kn-cash {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  height: 8rem;
  padding-bottom: 1rem;
  margin-top: 0.35rem;
}
.kn-cash__col {
  position: relative;
  flex: 1 1 0;
  min-width: 0.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.kn-cash__stack {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  height: 100%;
  justify-content: flex-start;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
}
.kn-cash__seg { display: block; width: 100%; }
.kn-cash__seg_paid { background: #2e844a; }
.kn-cash__seg_awaiting_payment { background: #0176d3; }
.kn-cash__seg_overdue { background: #ba0517; }
/* Draft and unbilled are money nobody has asked for yet — hollow rather than
   solid, so a column that looks full is not mistaken for one that is. */
.kn-cash__seg_draft {
  background: repeating-linear-gradient(45deg, #747474, #747474 2px, #f3f3f3 2px, #f3f3f3 5px);
}
.kn-cash__seg_not_invoiced {
  background: repeating-linear-gradient(45deg, #b0b0b0, #b0b0b0 2px, #fafafa 2px, #fafafa 5px);
}
.kn-cash__col.is-current .kn-cash__stack { outline: 1px solid #181818; outline-offset: 1px; }
.kn-cash__tick {
  position: absolute;
  bottom: -1rem; left: 0; right: 0;
  text-align: center;
  font-size: 0.625rem;
  color: #747474;
}
.kn-cash__col.is-current .kn-cash__tick { color: #181818; font-weight: 700; }
.kn-cash__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.75rem;
  font-size: 0.6875rem;
  color: #514f4d;
  margin-top: 0.6rem;
}
.kn-cash__key { display: inline-flex; align-items: center; gap: 0.3rem; }
.kn-cash__swatch {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  display: inline-block;
}

/* Company header: community highlight — same rhythm as Xero/Status badges */
.kn-community-hl {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}
.kn-community-copy {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--slds-g-color-brand-base-50, #0176d3);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.kn-community-copy:hover {
  text-decoration: underline;
  color: var(--slds-g-color-brand-base-40, #014486);
}
.kn-community-copy:focus-visible {
  outline: 2px solid var(--slds-g-color-brand-base-60, #0176d3);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Company Community tab — compact stat tiles */
.kn-portal-stats {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kn-portal-stat {
  background: var(--slds-g-color-neutral-base-95, #f3f3f3);
  border: 1px solid var(--slds-g-color-border-base-1, #e5e5e5);
  border-radius: 0.25rem;
  padding: 0.75rem 0.875rem;
  height: 100%;
  box-sizing: border-box;
}
.kn-portal-stat__value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--slds-g-color-neutral-base-10, #181818);
  margin: 0.15rem 0 0.2rem;
}
.kn-portal-stat__value_sm {
  font-size: 0.95rem;
  font-weight: 600;
}

/* htmx busy flag — hidden until the request it belongs to is in flight. */
.htmx-indicator { visibility: hidden; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { visibility: visible; }

/* Calendar — month grid + week view. A list can say a fortnight held four
   meetings; only a grid shows that they were all on one Tuesday. */
.kn-cal-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: .5rem;
}
.kn-cal-toggle {
  display: inline-flex; border: 1px solid #c9c9c9; border-radius: .25rem;
  overflow: hidden; background: #fff;
}
.kn-cal-toggle__btn {
  padding: .4rem .9rem; font-size: .8125rem; font-weight: 600;
  color: #514f4d; text-decoration: none; border-right: 1px solid #c9c9c9;
}
.kn-cal-toggle__btn:last-child { border-right: 0; }
.kn-cal-toggle__btn:hover { background: #f3f3f3; color: #181818; }
.kn-cal-toggle__btn.is-active {
  background: #0176d3; color: #fff;
}
.kn-cal-toggle__btn.is-active:hover { background: #014486; color: #fff; }
.kn-cal { border: 1px solid var(--slds-g-color-border-base-1, #e5e5e5); border-radius: .25rem; overflow: hidden; background: #fff; }
.kn-cal__head, .kn-cal__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.kn-cal__weekday {
  padding: .35rem .5rem; font-size: .6875rem; font-weight: 700; color: #514f4d;
  text-transform: uppercase; letter-spacing: .04em; background: #f3f3f3;
  border-bottom: 1px solid var(--slds-g-color-border-base-1, #e5e5e5);
}
.kn-cal__day {
  min-height: 7rem; padding: .3rem .35rem;
  border-right: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
  display: flex; flex-direction: column; gap: .15rem;
}
.kn-cal__day.is-outside { background: #fafaf9; }
.kn-cal__day.is-weekend:not(.is-outside) { background: #fcfcfb; }
.kn-cal__day.is-today { box-shadow: inset 0 0 0 2px #0176d3; }
.kn-cal__daynum { display: flex; justify-content: space-between; align-items: baseline; gap: .25rem; }
.kn-cal__daynum a { font-size: .8125rem; font-weight: 700; color: #181818; text-decoration: none; }
.kn-cal__daynum a:hover { text-decoration: underline; }
.kn-cal__day.is-outside .kn-cal__daynum a { color: #a8a8a8; font-weight: 400; }
.kn-cal__hours { font-size: .625rem; color: #2e844a; font-weight: 700; }
/* Solid = recorded and has a summary; outline = a diary entry only. */
.kn-cal__event {
  display: block; padding: .15rem .3rem; border-radius: .15rem;
  font-size: .6875rem; line-height: 1.25; text-decoration: none;
  border: 1px solid #0176d3; color: #032d60; background: #fff;
  overflow: hidden;
}
.kn-cal__event.is-recorded { background: #0176d3; border-color: #0176d3; color: #fff; }
.kn-cal__event:hover { filter: brightness(.95); }
.kn-cal__time { font-variant-numeric: tabular-nums; font-weight: 700; margin-right: .2rem; }
.kn-cal__title { }
.kn-cal__company { display: block; opacity: .8; font-size: .625rem; }
.kn-cal__empty {
  margin: .35rem 0 0; font-size: .6875rem; color: #a8a8a8;
}
/* Week view: one tall row so titles and companies stay readable. */
.kn-cal--week .kn-cal__day {
  min-height: min(70vh, 32rem);
  max-height: min(75vh, 36rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.kn-cal--week .kn-cal__daynum a { font-size: .875rem; }
.kn-cal--week .kn-cal__event {
  white-space: normal;
  padding: .25rem .35rem;
  font-size: .75rem;
}
.kn-cal--week .kn-cal__company { display: block; }
@media (max-width: 900px) {
  .kn-cal__day { min-height: 5rem; }
  .kn-cal:not(.kn-cal--week) .kn-cal__company { display: none; }
  .kn-cal--week .kn-cal__day { min-height: 14rem; max-height: 22rem; }
}

/* ==========================================================================
   Utility bar (Salesforce-style) + Agent panel
   ========================================================================== */

body {
    padding-bottom: 2.5rem; /* room for utility bar */
}

.kn-utility-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8000;
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 2.25rem;
    background: #16325c;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
    font-size: 0.75rem;
    color: #e5e5e5;
}
.kn-utility-bar__item {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.85rem;
    cursor: pointer;
    font: inherit;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.kn-utility-bar__item:hover,
.kn-utility-bar__item[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.1);
}
.kn-utility-bar__icon {
    width: 0.9rem;
    height: 0.9rem;
    fill: #fff;
}
.kn-utility-bar__label {
    font-weight: 600;
    letter-spacing: 0.01em;
}
.kn-utility-bar__spacer {
    flex: 1;
}
.kn-utility-bar__hint {
    padding: 0 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.65rem;
    align-self: center;
}

.kn-agent-panel {
    position: fixed;
    right: 0.75rem;
    bottom: 2.75rem;
    width: min(26rem, calc(100vw - 1.5rem));
    height: min(28rem, calc(100vh - 5rem));
    z-index: 8001;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 0.35rem 0.35rem 0.15rem 0.15rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.kn-agent-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.kn-agent-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e5e5e5;
    background: #f3f3f3;
    flex-shrink: 0;
}
.kn-agent-panel__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #181818;
}
.kn-agent-panel__sub {
    font-size: 0.7rem;
    color: #706e6b;
    margin-top: 0.1rem;
    max-width: 18rem;
}
.kn-agent-panel__messages {
    flex: 1;
    overflow: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: #fafaf9;
}
.kn-agent-msg {
    max-width: 95%;
    padding: 0.5rem 0.65rem;
    border-radius: 0.35rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.kn-agent-msg--system {
    align-self: stretch;
    background: #eef4ff;
    color: #032d60;
    border: 1px solid #d8e6fe;
}
.kn-agent-msg--user {
    align-self: flex-end;
    background: #0176d3;
    color: #fff;
}
.kn-agent-msg--assistant {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #181818;
}
.kn-agent-msg__meta {
    font-size: 0.65rem;
    color: #706e6b;
    margin-bottom: 0.25rem;
}
.kn-agent-msg--user .kn-agent-msg__meta {
    color: rgba(255, 255, 255, 0.75);
}
.kn-agent-panel__composer {
    display: flex;
    gap: 0.4rem;
    padding: 0.55rem 0.65rem;
    border-top: 1px solid #e5e5e5;
    background: #fff;
    flex-shrink: 0;
}
.kn-agent-input {
    flex: 1;
    resize: none;
    border: 1px solid #c9c9c9;
    border-radius: 0.25rem;
    padding: 0.4rem 0.5rem;
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.35;
    min-height: 2.4rem;
    max-height: 6rem;
}
.kn-agent-input:focus {
    outline: none;
    border-color: #0176d3;
    box-shadow: 0 0 0 1px #0176d3;
}
.kn-agent-send {
    align-self: flex-end;
    flex-shrink: 0;
}

/* GitHub repos table.

   table-layout is fixed and only the first column had a width, so the middle
   columns fought over the remainder and their inline forms — display:inline,
   so unable to wrap — spilled across each other. Every cell is now a stack
   that wraps, and every column has a width. */
.kn-gh-cell { vertical-align: top; }
.kn-gh-linkline {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem;
  overflow-wrap: anywhere;
}
.kn-gh-rowacts {
  display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem;
}
.kn-gh-rowacts form { display: contents; }
.kn-gh-projrow + .kn-gh-projrow {
  margin-top: .4rem; padding-top: .4rem; border-top: 1px solid #f0f0f0;
}
/* Repo-linking selects should not force the column wider than its share. */
.kn-gh-repos-table select.slds-select { max-width: 100%; }
