/* ============================================================
   BOND LOG PAGE — minimal row list, livefeed-inspired
   ============================================================ */

body.cardboard .bl-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px 96px;
    box-sizing: border-box;
}

/* ── Heading ── */
.bl-head {
    padding: 100px 0 36px;
}

body.cardboard .bl-head h1 {
    font-size: 2.3rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin: 0 0 10px;
    color: #fff;
    text-transform: none;
}

body.cardboard .bl-subtitle {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.42);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

/* ── Controls ── */
.bl-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
}

.bl-toggle {
    display: inline-flex;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.bl-toggle-btn {
    padding: 6px 14px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    text-transform: lowercase;
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}

.bl-toggle-btn:hover { color: rgba(255, 255, 255, 0.9); }

.bl-toggle-btn.active {
    color: #0a0a0a;
    background: #fff;
}

.bl-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.bl-filter-btn {
    padding: 5px 11px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    text-transform: lowercase;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bl-filter-btn:hover {
    color: rgba(255, 255, 255, 0.85);
}

.bl-filter-btn.active {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ── Groups ── */
.bl-group {
    padding: 20px 0 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.bl-group:last-of-type {
    border-bottom: none;
}

.bl-group-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 0 0 10px;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg,
        rgba(10, 10, 10, 1) 0%,
        rgba(10, 10, 10, 1) 70%,
        rgba(10, 10, 10, 0) 100%);
    z-index: 2;
}

.bl-group-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.55);
    text-transform: lowercase;
}

.bl-group-count {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    font-variant-numeric: tabular-nums;
}

/* ── Single-line bond rows ──
   Columns: date · type · name+issuer · isin · maturity · status */
.bl-row {
    display: grid;
    grid-template-columns: 70px 38px minmax(0, 1fr) auto auto auto;
    align-items: center;
    column-gap: 14px;
    padding: 7px 4px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.78);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-variant-numeric: tabular-nums;
}

.bl-row:last-child {
    border-bottom: none;
}

.bl-row:hover {
    background: rgba(255, 255, 255, 0.015);
}

.bl-row-date {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.bl-row-type {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

.bl-row-type[data-type="Government"] { color: #4FC3F7; }
.bl-row-type[data-type="Corporate"]  { color: #22c55e; }
.bl-row-type[data-type="SGB"]        { color: #FFB74D; }
.bl-row-type[data-type="Tax-free"]   { color: #a78bfa; }

.bl-row-name {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bl-row-name-text {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.86);
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.005em;
}

.bl-row-issuer {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.bl-row-maturity {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.38);
    white-space: nowrap;
}

/* Copyable ISIN — looks like quiet text, behaves like a button */
.bl-row-isin {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.38);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bl-row-isin:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
}

.bl-row-isin-icon {
    opacity: 0.55;
    flex-shrink: 0;
}

.bl-row-isin:hover .bl-row-isin-icon {
    opacity: 0.9;
}

.bl-row-isin.copied {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.25);
}

.bl-row-isin.copied .bl-row-isin-icon {
    display: none;
}

.bl-row-isin--empty {
    cursor: default;
    color: rgba(255, 255, 255, 0.2);
    padding: 3px 7px;
}

.bl-row-status {
    justify-self: end;
    white-space: nowrap;
}

.bl-status-live {
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(34, 197, 94, 0.8);
}

.bl-status-matured {
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(239, 68, 68, 0.85);
}

/* Matured strike-through — only name + dates, not the tag */
.bl-row.matured .bl-row-name-text,
.bl-row.matured .bl-row-issuer,
.bl-row.matured .bl-row-maturity,
.bl-row.matured .bl-row-date,
.bl-row.matured .bl-row-type {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.32);
}

.bl-row.matured .bl-row-type {
    color: rgba(255, 255, 255, 0.3);
}

/* ── Issuer-grouped view tweaks ── */
.bl-list[data-group="issuer"] .bl-group-header {
    text-transform: lowercase;
}

/* When grouped by issuer, hide the inline issuer label (it's redundant
   since the group header already names the issuer). The name span expands
   to fill the bond-name column alone. */
.bl-list[data-group="issuer"] .bl-row-issuer {
    display: none;
}

/* ── Loading / empty ── */
.bl-loading,
.bl-empty,
.bl-error {
    padding: 48px 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.88rem;
}

.bl-error {
    color: rgba(239, 68, 68, 0.75);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    body.cardboard .bl-main {
        padding: 0 18px 72px;
    }

    .bl-head {
        padding: 84px 0 28px;
    }

    body.cardboard .bl-head h1 {
        font-size: 1.85rem;
    }

    body.cardboard .bl-subtitle {
        font-size: 0.82rem;
    }

    .bl-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 0 16px;
    }

    .bl-toggle { align-self: flex-start; }
    .bl-filters { align-self: flex-start; }

    /* Row: tighter 6-column grid, small font, still single-line */
    .bl-row {
        grid-template-columns: 62px 36px minmax(0, 1fr) auto auto auto;
        column-gap: 10px;
        font-size: 0.72rem;
        padding: 7px 0;
    }

    .bl-row-date  { font-size: 0.66rem; }
    .bl-row-type  { font-size: 0.54rem; }
    .bl-row-issuer { font-size: 0.62rem; }
    .bl-row-maturity { font-size: 0.64rem; }
    .bl-row-isin { font-size: 0.62rem; padding: 3px 6px; }
    .bl-status-live,
    .bl-status-matured { font-size: 0.5rem; }
}

@media (max-width: 480px) {
    /* On very narrow screens, drop the issuer sub-column so the bond name
       gets full width. Issuer is still shown in the "by issuer" group header. */
    .bl-list[data-group="date"] .bl-row-issuer { display: none; }

    /* On very narrow screens, drop the maturity column (ISIN is more useful
       for lookups) so we can keep the row one line. */
    .bl-row-maturity { display: none; }

    .bl-row {
        grid-template-columns: 56px 32px minmax(0, 1fr) auto auto;
        column-gap: 8px;
    }

    .bl-row-isin {
        font-size: 0.58rem;
        padding: 2px 5px;
    }

    body.cardboard .bl-head h1 {
        font-size: 1.6rem;
    }
}
