/* ==========================================================
   Governed Agents Widget
   Standalone responsive card
   Uses variables.css tokens only
   ========================================================== */

.governed-agents-widget {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 600px;
    margin: 0px auto;
    flex-direction: column;
    padding: 28px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    container-type: inline-size;
}

.governed-agents-widget--compact {
    padding: 22px;
}

/* ==========================================================
   Header
   ========================================================== */

.governed-agents-widget__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.governed-agents-widget__title-group {
    min-width: 0;
}

.governed-agents-widget__heading {
    max-width: 330px;
    margin: 0;
    color: var(--color-black);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-lightbold);
    line-height: 1.3;
    letter-spacing: var(--letter-spacing-tight);
}

.governed-agents-widget__heading span {
    display: block;
    margin-top: 6px;
    color: var(--color-gray);
    font-size: var(--font-size-lg);
    font-weight: normal;
    line-height: var(--line-height-body);
}

.governed-agents-widget__product {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    color: var(--green-dark);
    font-size: var(--base-font-size);
    text-decoration: none;
}

.governed-agents-widget__product:hover {
    color: var(--green);
}

.governed-agents-widget__product:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 3px;
}

.governed-agents-widget__product i {
    width: 5px;
    height: 5px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--green);
}


.governed-agents-widget__open {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--light-dim-green);
    color: var(--green-dark);
    text-decoration: none;
    transition:
        background-color 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}

.governed-agents-widget__open:hover {
    background: var(--green);
    color: var(--white);
    transform: translate(2px, -2px);
}

.governed-agents-widget__open:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 3px;
}

.governed-agents-widget__open i,
.governed-agents-widget__open svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}
/* ==========================================================
   Task list
   ========================================================== */

.governed-agents-widget__tasks {
    display: grid;
    gap: 9px;
    margin-top: 28px;
}

.governed-agent-task {
    display: flex;
    min-width: 0;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--off-white);
    transition:
        border-color 180ms ease,
        background 180ms ease,
        transform 180ms ease;
}

.governed-agent-task:hover {
    border-color: var(--light-green-border);
    background: var(--white);
    transform: translateY(-1px);
}

.governed-agent-task__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.governed-agent-task__title {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: var(--color-black);
    font-size: var(--font-size-md);
    font-weight: var(--font-lightbold);
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.governed-agent-task__configuration {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
    margin: 0;
    color: var(--color-muted);
    font-size: var(--font-sm);
    line-height: 1.4;
}

.governed-agent-task__configuration div {
    display: flex;
    min-width: 0;
    width: 100%;
    gap: 8px;
}

.governed-agent-task__configuration dt {
    color: var(--color-gray);
    font-weight: var(--font-weight-semibold);
}

.governed-agent-task__configuration dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    text-align: left;
}

/* ==========================================================
   Governance check
   ========================================================== */

.governed-agents-widget__governance {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
    padding: 12px 13px;
    border: 1px solid var(--light-green-border);
    border-radius: var(--radius);
    background: var(--light-dim-green);
}

.governed-agents-widget__governance-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: var(--green-dark);
}

.governed-agents-widget__governance-icon i,
.governed-agents-widget__governance-icon svg {
    width: 15px;
    height: 15px;
}

.governed-agents-widget__governance p {
    margin: 0;
    color: var(--green-dark);
    font-size: var(--font-sm);
    font-weight: var(--font-lightbold);
    line-height: 1.45;
}

/* ==========================================================
   Result data
   ========================================================== */

.governed-agents-widget__results {
    margin-top: auto;
    padding-top: 18px;
}

.governed-agents-widget__results-label {
    margin: 0 0 10px;
    color: var(--color-light-gray);
    font-size: var(--font-sm);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
}

.governed-agents-widget__result-list {
    display: grid;
    gap: 7px;
    margin: 0;
}

.governed-agents-widget__result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 11px;
}

.governed-agents-widget__result dt,
.governed-agents-widget__result dd {
    margin: 0;
    font-family: monospace;
    font-size: var(--font-sm);
    line-height: 1.4;
}

.governed-agents-widget__result dt {
    color: var(--green-dark);
    font-weight: var(--font-weight-semibold);
}

.governed-agents-widget__result dd {
    min-width: 0;
    overflow: hidden;
    color: var(--color-gray);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================
   Medium container
   ========================================================== */

@container (max-width: 480px) {
    .governed-agents-widget {
        padding: 24px;
    }

    .governed-agents-widget__tasks {
        margin-top: 24px;
    }
}

/* ==========================================================
   Narrow container
   ========================================================== */

@container (max-width: 360px) {
    .governed-agents-widget {
        padding: 20px;
    }

    .governed-agents-widget__header {
        gap: 12px;
    }

    .governed-agents-widget__heading {
        font-size: var(--font-size-xl);
    }

    .governed-agent-task {
        min-height: 56px;
        padding: 10px 11px;
    }

    .governed-agent-task__title {
        white-space: normal;
    }

    .governed-agents-widget__governance {
        padding: 11px;
    }
}

/* ==========================================================
   Viewport fallback
   ========================================================== */

@media (max-width: 520px) {
    .governed-agents-widget__open {
        width: 26px;
        height: 26px;
    }
}

/* ==========================================================
   Reduced motion
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    .governed-agent-task,
    .governed-agents-widget__product {
        transition: none;
    }

    .governed-agent-task:hover {
        transform: none;
    }
}