/* All rules scoped under .api-requests to avoid global collisions while
   keeping the inner class names short and reusable within this panel. */

.api-requests .action {
    margin: 10px 0 12px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    background: rgba(100, 149, 237, 0.04);
}
.api-requests .action-header { margin-bottom: 8px; }
.api-requests .action-title { font-weight: 650; opacity: 0.95; line-height: 1.35; }

/* Generic row */
.api-requests .row {
    margin: 4px 0;
    padding: 4px 8px;
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    transition: background-color 120ms ease;
}

/* Row hierarchy: indent + accent + base bg */
.api-requests .row-invocation { margin-left: 10px; padding: 3px 8px; border-left-color: rgba(76, 175, 80, 0.35);  background: rgba(76, 175, 80, 0.08); }
.api-requests .row-step       { margin-left: 22px; padding: 6px 8px; border-left-color: rgba(100, 200, 255, 0.35); background: rgba(100, 200, 255, 0.07); }
.api-requests .row-http       { margin-left: 34px; padding: 4px 6px 4px 4px; border-left-color: rgba(33, 150, 243, 0.35); background: rgba(33, 150, 243, 0.06); }
.api-requests .row-compaction { margin-left: 34px; padding: 5px 8px; border-left-color: rgba(156, 39, 176, 0.5); background: rgba(156, 39, 176, 0.08); }
.api-requests .row-orphan     { margin-left: 0; }

/* Row state overrides */
.api-requests .row-pending { background: rgba(255, 193, 7, 0.13); }
.api-requests .row-dummy   { background: rgba(255, 152, 0, 0.08); }
.api-requests .row-error   { background: rgba(244, 67, 54, 0.13); }

.api-requests .row-invocation:hover { background: rgba(76, 175, 80, 0.16); }
.api-requests .row-step:hover       { background: rgba(100, 200, 255, 0.16); }

/* HTTP row internal grid: [icon] [time/duration column] [content column] */
.api-requests .http-grid {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 0;
}
.api-requests .http-btn   { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.api-requests .http-line1 { grid-column: 3; grid-row: 1; font-size: 12.5px; line-height: 1.1; }
.api-requests .row-http .time     { grid-column: 2; grid-row: 1; }
.api-requests .row-http .duration { grid-column: 2; grid-row: 2; }
.api-requests .url { grid-column: 3; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 11px; line-height: 1.1; }

/* Time / duration block (for invocation/step rows) */
.api-requests .time-block { display: inline-flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.api-requests .time     { font-size: 11px; opacity: 0.55; white-space: nowrap; }
.api-requests .duration { font-size: 11px; font-weight: 500; opacity: 0.9; white-space: nowrap; }

/* Chip pill */
.api-requests .chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 1px 8px 2px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    white-space: nowrap;
    line-height: 1.05;
    font-size: 12px;
    opacity: 0.9;
}
.api-requests .chip-label { font-size: 9px; opacity: 0.62; text-transform: uppercase; letter-spacing: 0.04em; }
.api-requests .chip-value { font-size: 12px; font-weight: 650; opacity: 0.95; }

.api-requests .token-chip {
    display: inline-flex;
    flex-direction: column;
    min-width: 138px;
    padding: 3px 8px 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    line-height: 1.05;
    opacity: 0.9;
}

.api-requests .token-chip__headers,
.api-requests .token-chip__values {
    display: grid;
    grid-template-columns: minmax(54px, 1fr) minmax(38px, auto) minmax(38px, auto);
    column-gap: 8px;
    align-items: start;
}

.api-requests .token-chip__headers {
    font-size: 9px;
    opacity: 0.62;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.api-requests .token-chip__primary {
    display: block;
    font-size: 12px;
    font-weight: 650;
    opacity: 0.95;
}

.api-requests .token-chip__cached {
    display: block;
    margin-top: 1px;
    font-size: 10px;
    font-weight: 400;
    opacity: 0.68;
}

/* Text helpers */
.api-requests .muted        { opacity: 0.72; }
.api-requests .bold         { font-weight: 700; }
.api-requests .text-info    { color: var(--mud-palette-info); }
.api-requests .text-success { color: var(--mud-palette-success); }
.api-requests .text-warning { color: var(--mud-palette-warning); }
.api-requests .text-error   { color: var(--mud-palette-error); }
.api-requests .text-tools   { color: orange; }
.api-requests .ml-auto      { margin-left: auto; }

.api-requests .error-text { margin-top: 2px; color: var(--mud-palette-error); font-size: 11px; }

.api-requests .orphan-label {
    margin: 8px 0 4px;
    padding: 5px 8px;
    border-left: 3px solid rgba(255, 165, 0, 0.45);
    border-radius: 5px;
    color: var(--mud-palette-warning);
    font-weight: 650;
    background: rgba(255, 165, 0, 0.08);
}
