/* Insights: the ranked briefing at the top, and the deeper tables below. */

.brief { margin: 18px 0 8px; padding: 18px 18px 12px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft), 0 8px 24px -14px rgba(15, 15, 15, .18); }
.brief-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.brief-head h2 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.brief-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.brief-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.bf-count { padding: 3px 10px; border-radius: 99px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.bf-count b { color: var(--text); }
.bf-count.critical b { color: var(--danger); }
.bf-count.watch b { color: var(--warn); }
.bf-count.good b { color: var(--ok); }

.brief-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bf { --lc: var(--muted); display: flex; align-items: flex-start; gap: 12px; padding: 11px 8px 11px 12px; border-top: 1px solid var(--border-soft); border-left: 3px solid var(--lc); border-radius: 0 8px 8px 0; margin-left: -4px; }
.brief-list > .bf:first-child { border-top: 0; }
.bf[data-act] { cursor: pointer; }
.bf[data-act]:hover { background: var(--hover, var(--surface-2)); }
.bf.critical { --lc: var(--danger); }
.bf.watch { --lc: var(--warn); }
.bf.good { --lc: var(--ok); }
.bf.info { --lc: var(--border); }
.bf-n { width: 22px; flex-shrink: 0; padding-top: 1px; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.bf-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.bf-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bf-top b { font-size: 14.5px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.bf-tag { flex-shrink: 0; padding: 1px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, transparent); }
.bf.info .bf-tag { color: var(--muted); }
.bf-detail { font-size: 13px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.bf-go { flex-shrink: 0; align-self: center; color: var(--muted); opacity: .6; }
/* The first three stand out a little more: they are what the page is for. */
.brief-list:not(.brief-more .brief-list) > .bf:nth-child(-n+3) .bf-top b { font-size: 15.5px; }
.brief-more { margin-top: 2px; border-top: 1px solid var(--border-soft); }
.brief-more summary { padding: 10px 4px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; list-style: none; }
.brief-more summary::-webkit-details-marker { display: none; }
.brief-more summary::after { content: " ▾"; }
.brief-more[open] summary::after { content: " ▴"; }
.brief-more summary:hover { color: var(--text); }
.brief-clear { margin: 6px 2px 8px; color: var(--muted); font-size: 14px; }

/* Tables: goal forecast, habits by weekday */
.insx-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }
.insx-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.insx-table th { text-align: left; padding: 6px 10px; font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.insx-table td { padding: 9px 10px; border-top: 1px solid var(--border-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.insx-table tbody tr { cursor: pointer; }
.insx-table tbody tr:hover { background: var(--hover, var(--surface-2)); }
.insx-table .insx-name { white-space: normal; min-width: 150px; max-width: 320px; font-weight: 550; }
.insx-table .ok { color: var(--ok); font-weight: 600; }
.insx-table .danger { color: var(--danger); font-weight: 600; }
.insx-table .warn { color: var(--warn); font-weight: 600; }
.insx-table.heat th:not(:first-child) { text-align: center; padding: 6px 4px; }
.insx-table.heat td.insx-heat { text-align: center; padding: 4px; border-top: 0; font-size: 12px; font-weight: 600; min-width: 40px; position: relative; z-index: 0; }
.insx-table.heat td.insx-heat::before { content: ""; position: absolute; inset: 3px; border-radius: 7px; background: var(--c, var(--accent)); opacity: var(--o, 0); z-index: -1; }
.insx-table.heat td.insx-name { border-top: 0; padding: 6px 10px 6px 4px; }

.insx-old { margin-top: 6px; }
.insx-old .stat-row b.danger { color: var(--danger); }

/* Weekly priorities: this week and last */
.insx-weeks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.insx-week { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.insx-week-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.insx-week p { margin: 0; }
.insx-pr { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; font-size: 14px; line-height: 1.4; }
.insx-dot { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; }
.insx-pr.done { color: var(--muted); }
.insx-pr.done .insx-dot { background: var(--ok); border-color: var(--ok); color: #fff; }

@media (max-width: 760px) {
  .brief { padding: 14px 12px 8px; margin-left: -2px; margin-right: -2px; }
  .bf { gap: 9px; padding: 10px 4px 10px 9px; }
  .bf-n { width: 18px; }
  .bf-go { display: none; }
  .insx-weeks { grid-template-columns: 1fr; }
  .insx-table { font-size: 13px; }
  .insx-table td, .insx-table th { padding-left: 7px; padding-right: 7px; }
  .insx-table .insx-name { min-width: 120px; }
  .insx-table.heat td.insx-heat { min-width: 34px; }
}