/* Our Institutions */

/* ---------- Intro ---------- */
.in-intro { padding: clamp(48px, 7vw, 104px) var(--gutter) clamp(40px, 5vw, 72px); }
.in-intro__row { display: flex; flex-wrap: wrap; gap: 40px clamp(32px, 5vw, 80px); align-items: flex-end; }
.in-intro__main { flex: 2 1 560px; min-width: 0; }
.in-kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--text-inverse-soft); margin-bottom: 24px; }
.in-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(52px, 8vw, 128px); line-height: .94; letter-spacing: -.035em; }
.in-title .it { font-style: italic; }
.in-lead { margin-top: 28px; max-width: 52ch; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: rgba(255,255,255,.85); }
.in-verts { flex: 1 1 300px; max-width: 440px; display: flex; flex-direction: column; border-top: 1px solid var(--white); }
.in-verts__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-inverse); }
.in-verts__row dt { display: flex; gap: 12px; align-items: baseline; font-size: 15px; }
.in-verts__row .code { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-mono); color: rgba(255,255,255,.55); }
.in-verts__row dd { font-family: var(--font-mono); font-size: 13px; }
.in-verts__row--total { border-bottom-color: var(--white); font-weight: 600; }
.in-verts__row--total dt { font-size: inherit; }

/* ---------- Grid section + toolbar ---------- */
.in-grid { padding: clamp(32px, 4vw, 56px) var(--gutter) clamp(56px, 7vw, 96px); }
.in-toolbar { position: sticky; top: 0; z-index: 10; background: var(--white); display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--black); }

.in-views { display: none; border: 1px solid var(--black); }
.in-views button { min-height: 40px; padding: 0 16px; display: flex; align-items: center; background: var(--white); color: var(--black); border: 0; border-radius: 0; font-size: 14px; font-weight: 600; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.in-views button[aria-selected="true"] { background: var(--black); color: var(--white); }

.in-filters { display: none; flex-wrap: wrap; gap: 6px; align-items: center; }
.in-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.in-sep { width: 1px; height: 24px; background: rgba(0,0,0,.2); margin: 0 6px; }
.in-chips--lg .chip { min-height: 44px; padding: 0 14px; font-size: 15px; font-weight: 400; }

.in-filter-btn { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0; background: none; border: 0; font-weight: 600; }
.in-filter-btn .n { font-family: var(--font-mono); font-size: 11px; }
.in-count { font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tracking-mono); text-transform: uppercase; }

@media (min-width: 960px) {
  .in-views, .in-filters { display: flex; }
  .in-filter-btn { display: none; }
}

/* Panels: below 960px only the index exists. */
.in-panel[hidden] { display: none; }
@media (max-width: 959px) {
  .in-panel--matrix, .in-panel--matrix[hidden] { display: none; }
  .in-panel--index, .in-panel--index[hidden] { display: block; }
}

/* ---------- Matrix ---------- */
.matrix { border-left: 1px solid var(--line); margin-top: 24px; }
.m-row { display: grid; border-bottom: 1px solid var(--line); }
.m-row--head { border-top: 1px solid var(--black); border-bottom: 1px solid var(--black); }
.m-corner { padding: 12px; border-right: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--grey-5); }
.m-colhead { padding: 12px; border-right: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.m-colhead .lbl { font-family: var(--font-display); font-size: 24px; line-height: 1; letter-spacing: -.02em; }
.m-colhead .code { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); color: var(--grey-5); white-space: nowrap; }
.m-rowhead { padding: 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; background: var(--grey-1); }
.m-rowhead .code { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-mono); color: var(--grey-5); }
.m-rowhead .lbl { font-size: 15px; font-weight: 600; line-height: 1.25; }
.m-cell { border-right: 1px solid var(--line); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 1px; background: rgba(0,0,0,.1); min-height: 128px; min-width: 0; }
.m-empty { flex: 1; min-height: 128px; background: var(--white); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; color: var(--grey-placeholder); }
.in-none { padding: 24px 12px; border-right: 1px solid var(--line); color: var(--grey-5); font-size: 15px; }

.tile { flex: 1 1 160px; min-height: 128px; background: var(--white); color: var(--black); position: relative; display: flex; flex-direction: column; padding: 0; border: 0; border-radius: 0; text-align: left; font: inherit; transition: box-shadow 180ms var(--ease); }
.tile:hover, .tile.is-sel { box-shadow: var(--edge-selected); }
.tile__top { display: flex; justify-content: space-between; padding: 8px 10px 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--grey-5); line-height: 1.55; }
.tile__top .dev { color: var(--black); }
.tile__logo { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6px 18px; }
.tile__logo img { max-width: 100%; max-height: 48px; width: auto; height: auto; }
.tile__foot { padding: 0 10px 8px; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 500; line-height: 1.25; color: var(--grey-3); }
.tile__foot .yr { font-family: var(--font-mono); font-size: 10px; color: var(--grey-5); }
img.is-dev { opacity: .55; }

.matrix-note { margin-top: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--grey-5); }

/* ---------- Index (real table) ---------- */
.in-table { width: 100%; margin-top: 24px; border-collapse: collapse; table-layout: fixed; }
/* Columns 56px 150px 2.4fr 1fr 1.2fr 1.1fr 1.4fr 32px with a 16px gap (gap carried as cell padding-right). */
col.c-num { width: 72px; } col.c-logo { width: 166px; } col.c-go { width: 36px; }
col.c-name { width: 25%; } col.c-region { width: 10.5%; } col.c-vert { width: 12.6%; } col.c-year { width: 11.5%; } col.c-url { width: 14.6%; }
.in-table th, .in-table td { padding: 0 16px 0 0; text-align: left; vertical-align: middle; }
.in-table th:last-child, .in-table td:last-child { padding-right: 4px; text-align: right; }
.in-table thead th { height: 44px; border-top: 1px solid var(--black); border-bottom: 1px solid var(--black); font-family: var(--font-mono); font-size: 10px; font-weight: 400; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--grey-5); }
.in-table th button { min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 0; background: none; border: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.in-table th[aria-sort] { color: var(--black); }
.in-table tbody tr { cursor: pointer; transition: background 180ms var(--ease); }
.in-table tbody tr:hover { background: var(--grey-1); }
.in-table tbody td { height: 80px; border-bottom: 1px solid var(--line); }
.in-table td.c-num { padding-left: 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); color: var(--grey-5); }
.in-table .logo { height: 56px; display: flex; align-items: center; justify-content: flex-start; }
.in-table .logo img { max-height: 40px; max-width: 100%; width: auto; height: auto; }
.in-table .open { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 44px; justify-content: center; padding: 0; background: none; border: 0; text-align: left; font: inherit; color: inherit; }
.in-table .open .nm { font-size: 16px; font-weight: 600; line-height: 1.3; }
.in-table .meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--grey-5); line-height: 1.5; }
.in-table .meta--narrow { display: none; }
.in-table td.c-region, .in-table td.c-vert { font-size: 15px; }
.in-table td.c-year { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; }
.in-table td.c-url { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--grey-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-table tr.is-sel td { box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.in-table tr.is-sel td:first-child { box-shadow: inset 2px 0 0 var(--accent), inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.in-table tr.is-sel td:last-child { box-shadow: inset -2px 0 0 var(--accent), inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.in-table tr.in-none { cursor: default; }
.in-table tr.in-none td { text-align: left; color: var(--grey-5); font-size: 15px; padding-left: 4px; }

@media (max-width: 959px) {
  /* Mobile columns: 28px 84px 1fr 20px; header row hidden visually. */
  col.c-num { width: 44px; } col.c-logo { width: 100px; } col.c-go { width: 24px; } col.c-name { width: auto; }
  .in-table .c-region, .in-table .c-vert, .in-table .c-year, .in-table .c-url { display: none; }
  .in-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .in-table tbody tr:first-child td { border-top: 1px solid var(--black); }
  .in-table .meta--wide { display: none; }
  .in-table .meta--narrow { display: block; }
}

/* ---------- Filter sheet ---------- */
.in-sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); }
.in-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--white); border-top: 1px solid var(--black); padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 20px; max-height: 80vh; overflow: auto; }
.in-sheet[hidden], .in-sheet-backdrop[hidden] { display: none; }
.in-sheet__head { display: flex; justify-content: space-between; align-items: center; }
.in-sheet__title { font-family: var(--font-display); font-size: 28px; }
.in-sheet__clear { min-height: 44px; padding: 0; background: none; border: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); text-transform: uppercase; }
.in-sheet__group { display: flex; flex-direction: column; gap: 8px; }
.in-sheet__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--grey-5); }
.in-sheet__show { min-height: 52px; background: var(--black); color: var(--white); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border: 0; border-radius: 0; font-weight: 600; width: 100%; }

/* ---------- Detail drawer ---------- */
.in-drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); }
.in-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(560px, 100%); background: var(--white); border-left: 1px solid var(--black); display: flex; flex-direction: column; overflow: hidden; }
.in-drawer[hidden], .in-drawer-backdrop[hidden] { display: none; }
.in-drawer__bar { background: var(--black); color: var(--white); display: flex; align-items: stretch; justify-content: space-between; min-height: 56px; font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); text-transform: uppercase; }
.in-drawer__pos { display: flex; align-items: center; padding: 0 20px; }
.in-drawer__nav { display: flex; }
.in-drawer__nav button { min-width: 56px; display: flex; align-items: center; justify-content: center; background: none; color: inherit; border: 0; border-left: 1px solid var(--line-inverse); border-radius: 0; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.in-drawer__nav button:hover { background: var(--black-2); }
.in-drawer__nav button.close { min-width: 72px; padding: 0 12px; }
.in-drawer__nav button:focus-visible { outline-offset: -2px; }
.in-drawer__scroll { flex: 1; overflow: auto; }
.in-drawer__logo { height: 200px; display: flex; align-items: center; justify-content: center; padding: 32px 48px; border-bottom: 1px solid var(--black); position: relative; }
.in-drawer__logo img { max-width: 100%; max-height: 96px; width: auto; height: auto; }
.in-drawer__logo .dev-tag { position: absolute; top: 12px; right: 12px; border: 1px solid var(--black); padding: 2px 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-mono); text-transform: uppercase; }
.in-drawer__head { padding: 28px 24px 0; }
.in-drawer__head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 4vw, 44px); line-height: 1.02; letter-spacing: -.025em; }
.in-drawer__dl { margin: 24px 24px 0; border-top: 1px solid var(--black); }
.in-drawer__dl > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.in-drawer__dl dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--grey-5); padding-top: 3px; }
.in-drawer__dl dd { font-size: 15px; }
.in-drawer__label { padding: 28px 24px 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); text-transform: uppercase; }
.in-drawer__facts { margin: 0 24px; border-top: 1px solid var(--black); }
.in-drawer__facts li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.in-drawer__facts .n { font-family: var(--font-mono); font-size: 11px; color: var(--grey-5); padding-top: 3px; }
.in-drawer__facts .t { font-size: 16px; line-height: 1.5; }
.in-drawer__source { padding: 16px 24px 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--grey-5); }
.in-drawer__cta { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 24px; background: var(--black); color: var(--white); text-decoration: none; font-weight: 600; }
a.in-drawer__cta:hover { background: var(--black-2); }
.in-drawer__cta:focus-visible { outline-offset: -4px; }

/* Polish: hairlines come from the tiles, so unused cell space stays white. */
.m-cell { background: var(--white); }
.tile { box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.tile:hover, .tile.is-sel { box-shadow: var(--edge-selected), 0 0 0 1px rgba(0,0,0,.1); }
