/* ---- The sentence: every choice is a slot in it. Slots you can't reach yet are grey;
   the next one to fill is underlined and pulses gently. ---- */
#compare .build-sentence { font-size: 1rem; line-height: 2.3; font-weight: 300; color: #374151; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.4em; }
@media (min-width: 768px) { #compare .build-sentence { font-size: 1.125rem; } }
#compare .nw { white-space: nowrap; }
#compare .slot { position: relative; display: inline-block; }
#compare .s-btn, #compare .s-input { font: inherit; font-weight: 700; color: #ea580c; background: transparent; border: 0; border-bottom: 1.5px solid #fb923c; padding: 0 2px 1px; cursor: pointer; line-height: 1.5; outline: none; }
#compare .s-btn { display: inline-flex; align-items: baseline; gap: 6px; max-width: min(34rem, calc(100vw - 48px)); text-align: left; }
#compare .s-btn .s-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#compare .s-btn i { font-size: 0.6em; opacity: 0.7; align-self: center; }
#compare .s-input { cursor: text; min-width: 6ch; max-width: calc(100vw - 48px); }
#compare .s-input::placeholder { color: #fdba74; font-weight: 600; }
#compare .slot:not(.filled) .s-btn { color: #fdba74; font-weight: 600; }
#compare .slot.next .s-btn, #compare .slot.next .s-input { border-bottom-color: var(--pink); animation: cmpSlotPulse 1.6s ease-in-out infinite; }
@keyframes cmpSlotPulse { 0%, 100% { box-shadow: 0 1.5px 0 0 rgba(221, 71, 96, 0); } 50% { box-shadow: 0 1.5px 0 0 rgba(221, 71, 96, 0.9); } }
#compare .slot.off .s-btn, #compare .slot.off .s-input { color: #c9c3ad !important; border-bottom: 1.5px dashed #d8d2bb; cursor: not-allowed; font-weight: 600; animation: none; }
#compare .slot.off .s-input::placeholder { color: #c9c3ad; }
#compare .slot.locked { font-weight: 700; color: #2F2549; cursor: help; }
#compare .slot.locked i { font-size: 0.6em; color: #9ca3af; margin-left: 2px; }
@media (prefers-reduced-motion: reduce) { #compare .slot.next .s-btn, #compare .slot.next .s-input { animation: none; } }

#compare .dd-panel { display: block; position: absolute; left: 0; top: calc(100% + 6px); min-width: 15rem; max-width: min(26rem, calc(100vw - 32px)); max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid #f0f0f0; border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); z-index: 80; padding: 6px 0; font-size: 14px; font-weight: 500; color: #374151; line-height: 1.3; }
#compare .dd-panel.flip { left: auto; right: 0; }
#compare .dd-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer; transition: background .12s; white-space: normal; }
#compare .dd-item:hover, #compare .dd-item.active { background: #fdf0f2; }
#compare .dd-item.sel { color: var(--dark-purple); font-weight: 700; }
#compare .dd-item.ind { padding-left: 34px; }
#compare .dd-item.ind2 { padding-left: 54px; font-size: 13px; }
#compare .dd-item .dd-meta { margin-left: auto; font-size: 11px; color: #9ca3af; white-space: nowrap; padding-left: 10px; }
#compare .dd-check { width: 14px; flex-shrink: 0; text-align: center; color: var(--pink); font-size: 12px; }
#compare .dd-head { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #9ca3af; padding: 10px 14px 4px; }
#compare .dd-filter { display: block; width: calc(100% - 16px); margin: 2px 8px 6px; padding: 6px 10px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; outline: none; }
#compare .dd-filter:focus { border-color: var(--pink); }
#compare .dd-foot { position: sticky; bottom: -6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border-top: 1px solid #f3f4f6; margin-top: 4px; padding: 8px 14px; font-size: 12px; color: #6b7280; }
#compare .dd-foot button { background: var(--pink); color: #fff; font-weight: 700; border-radius: 6px; padding: 4px 12px; }
#compare .dd-empty { padding: 12px 14px; font-size: 12px; color: #9ca3af; font-style: italic; }

/* ---- Institution search: same list as the search above ---- */
#compare .picker-list { display: block; position: absolute; left: 0; top: calc(100% + 6px); width: min(440px, calc(100vw - 32px)); max-height: 380px; overflow-y: auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); z-index: 80; padding: 4px; font-size: 13px; font-weight: 500; color: #374151; line-height: 1.3; }
#compare .picker-list.flip { left: auto; right: 0; }
#compare .picker-filters { position: sticky; top: -4px; z-index: 2; background: #fff; display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 6px 7px; margin: -4px -4px 2px; border-bottom: 1px solid #f0eee3; }
#compare .pf-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #6b7280; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 999px; padding: 3px 9px; cursor: pointer; user-select: none; transition: all .12s; white-space: nowrap; line-height: 1.4; }
#compare .pf-pill b { font-weight: 800; color: #9ca3af; }
#compare .pf-pill:hover { border-color: #d1d5db; }
#compare .pf-pill.on { background: var(--pink); border-color: var(--pink); color: #fff; }
#compare .pf-pill.on b { color: rgba(255,255,255,.85); }
#compare .pf-pill.zero { opacity: .45; }
#compare .picker-head { display: flex; align-items: center; justify-content: space-between; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #9ca3af; padding: 6px 9px 3px; }
#compare .picker-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
#compare .picker-row:hover, #compare .picker-row.active { background: #fdf0f2; }
#compare .picker-row .pr-main { flex: 1; min-width: 0; }
#compare .picker-row .pr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: #1f2937; }
#compare .picker-row .pr-meta { font-size: 11px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#compare .picker-row .pr-share { font-weight: 800; font-size: 12px; color: #6b7280; flex-shrink: 0; }
#compare .pr-mark { width: 14px; height: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
#compare .pr-dot { width: 9px; height: 9px; border-radius: 999px; background: rgba(170, 170, 170, 0.55); }
#compare .pr-dot.on { width: 12px; height: 12px; background: var(--pink); border: 2px solid #000; }
#compare .picker-empty { padding: 14px 10px; font-size: 12px; color: #9ca3af; font-style: italic; text-align: center; }

#compare .add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
#compare .btn-add { background: var(--pink); color: #fff; font-weight: 700; padding: 10px 22px; border-radius: 999px; transition: background .15s, opacity .15s; }
#compare .btn-add:hover:not(:disabled) { background: #c73550; }
#compare .btn-add:disabled { opacity: .45; cursor: not-allowed; }
#compare .btn-link { font-size: 13px; font-weight: 700; color: #6b7280; }
#compare .btn-link:hover { color: var(--pink); text-decoration: underline; }
#compare .add-hint { font-size: 12.5px; color: #9ca3af; }
#compare .add-hint.warn { color: #c2410c; }

#compare .chart-kind { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: #efead0; color: #8a8470; }
#compare .chart-kind.set { background: #fdf0f2; color: var(--pink); }
#compare .chart-area { position: relative; min-height: 320px; }
#compare .chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 24px; color: #9ca3af; font-size: 14px; font-style: italic; }
#compare .item-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
#compare .item-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #374151; padding: 4px 6px 4px 11px; border-radius: 999px; border: 1px solid #e5e7eb; background: #fff; max-width: 100%; }
#compare .item-chip .ic-dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }
#compare .item-chip .ic-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#compare .item-chip .ic-sub { color: #9ca3af; font-weight: 500; }
#compare .item-chip button { width: 20px; height: 20px; border-radius: 999px; background: #f3f4f6; color: #6b7280; font-size: 9px; flex-shrink: 0; }
#compare .item-chip button + button { margin-left: -3px; }
#compare .item-chip button[data-act="remove"]:hover { background: #fee2e2; color: #dc2626; }
#compare .item-chip button[data-act="rename"]:hover, #compare .item-chip button[data-act="ok"]:hover { background: #fdf0f2; color: var(--pink); }
#compare .item-chip.editing { border-color: var(--pink); }
#compare .item-chip .ic-input { font: inherit; font-size: 12px; font-weight: 600; color: #374151; border: 0; outline: none; background: transparent; padding: 0; min-width: 6ch; max-width: 60vw; }
#compare .title-row { display: flex; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
@media (max-width: 640px) { #compare .title-row { flex-wrap: wrap; } }
#compare .title-input { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--dark-purple); padding: 7px 14px; border: 1px solid #e5e7eb; border-radius: 10px; background: transparent; outline: none; }
#compare .title-input::placeholder { color: #b8b19a; font-weight: 600; }
#compare .title-input:focus { border-color: var(--pink); }

/* ---- Popups (make a group, export) ---- */
#compare .modal-overlay { position: fixed; inset: 0; background: rgba(17, 12, 34, 0.5); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
#compare .modal-overlay.on { display: flex; }
#compare .modal-content { background: #fff; padding: 1.75rem; border-radius: 14px; width: 100%; max-width: 560px; position: relative; max-height: calc(100vh - 2rem); overflow-y: auto; }
#compare .modal-close { position: absolute; top: 0.9rem; right: 1.1rem; font-size: 1.5rem; color: #9ca3af; cursor: pointer; line-height: 1; }
#compare .gm-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #9ca3af; margin: 14px 0 6px; }
#compare .gm-input { width: 100%; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 14px; outline: none; }
#compare .gm-input:focus { border-color: var(--pink); }
#compare .gm-pick { position: relative; }
#compare .gm-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); z-index: 5; padding: 4px 0; display: none; font-size: 13px; }
#compare .gm-list.open { display: block; }
#compare .gm-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 30px; }
#compare .gm-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; background: #fdf0f2; color: #9d2b40; padding: 3px 5px 3px 10px; border-radius: 999px; }
#compare .gm-chip button { width: 18px; height: 18px; border-radius: 999px; font-size: 9px; color: #9d2b40; }
#compare .gm-chip button:hover { background: #fbd5dd; }
#compare .gm-none { font-size: 12px; color: #9ca3af; font-style: italic; }
#compare .ex-head { font-size: 15px; font-weight: 700; color: #374151; margin-bottom: 12px; }
#compare .ex-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1023px) { #compare .ex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { #compare .ex-grid { grid-template-columns: 1fr; } }
#compare .ex-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: left; background: #fffdf3; border: 1px solid #efe9cf; border-radius: 14px; padding: 10px 10px 14px; transition: transform .15s, box-shadow .15s, border-color .15s; }
#compare .ex-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(47, 37, 73, .08); border-color: #e3dcbc; }
#compare .ex-card.on { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(221, 71, 96, .15); }
#compare .ex-card.loading { cursor: progress; opacity: .7; }
#compare .ex-pic { height: 130px; border-radius: 8px; border: 1px solid #f1eddb; pointer-events: none; }
#compare .ex-title { font-size: 14px; font-weight: 700; color: #1f2937; line-height: 1.35; padding: 0 2px; }
#compare .ex-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; font-size: 11px; font-weight: 700; color: #9ca3af; }
#compare .ex-divider::before, #compare .ex-divider::after { content: ''; flex: 1; border-top: 1px solid #ebe5cb; }
