Last modified by Veronika Kocher on Friday, 04 Sep 2026 14:45

From version 9.5
edited by Veronika Kocher
on Thursday, 03 Sep 2026 10:09
Change comment: There is no comment for this version
To version 9.9
edited by Veronika Kocher
on Friday, 04 Sep 2026 14:23
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -58,7 +58,7 @@
58 58  <section class="card" style="margin-bottom:18px;overflow:hidden;border-left:6px solid #e94b13;">
59 59  <div class="hero"><img src="https://xwiki.uni-ak.ac.at/bin/download/Service%20Navigator/Art%20%26%20Research%20Services%20Navigator/WebHome/enable.png" alt="Planning and organising an artistic or research project"></div>
60 60  <div style="padding:18px 21px 20px">
61 -<div class="eye" style="color:#8a4d36;margin-bottom:5px">ENABLE · PROJECT PLANNING &amp; ORGANISATION</div>
61 +<div class="eye" style="color:#8a4d36;margin-bottom:5px">PREPARE · PROJECT PLANNING &amp; ORGANISATION</div>
62 62  <h2 style="font-size:27px;line-height:1.2;margin:0 0 8px;color:#2c2926">Build a project that can actually be hosted, funded, staffed and delivered</h2>
63 63  <p style="margin:0;color:#5e5953;line-height:1.6;max-width:1120px">Project planning at the Angewandte is not only a timeline and a budget. A workable project needs an artistic or research home, clear responsibilities, an appropriate funding and administrative route, and early coordination with the university structures triggered by your project.</p>
64 64  </div></section>
... ... @@ -415,6 +415,14 @@
415 415  
416 416  <div class="info" style="margin-bottom:14px"><strong>Need help structuring the project?</strong> For funded, artistic, scientific and arts-based research projects, Support Kunst und Forschung is a central coordination point. Bring a short project description, host unit, likely applicant, partners, duration, rough budget and the main things you need from the University.</div>
417 417  
418 +<!-- ARSN_TRAINING_WORKSHOPS_INCLUDE_V1_START -->
419 +{{include reference="Service Navigator.Art & Research Services Navigator.Code.TrainingWorkshopsBlock" author="target" /}}
420 +<!-- ARSN_TRAINING_WORKSHOPS_INCLUDE_V1_END -->
421 +
422 +<!-- ARSN_PRACTICAL_RESOURCES_FALLBACK_V1_START -->
423 +{{include reference="Service Navigator.Art & Research Services Navigator.Code.PracticalResourcesFallbackBlock" author="target" /}}
424 +<!-- ARSN_PRACTICAL_RESOURCES_FALLBACK_V1_END -->
425 +
418 418  <!-- ARSN_SEARCH_TERMS_START -->
419 419  <details style="margin-top:24px;padding-top:10px;border-top:1px solid #e3ded6">
420 420  <summary style="cursor:pointer;color:#6a655e;font-size:13px">Search terms &amp; related topics</summary>
... ... @@ -425,12 +425,13 @@
425 425  </div>
426 426  {{/html}}
427 427  
428 -\n\n
429 -\n\n{{html clean="false"}}
430 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_START -->
436 +{{html clean="false"}}
437 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START -->
431 431  
432 -<style data-sn-horizontal-box-harmonizer="7">
433 -/* ---------- Typography: never justify headings ---------- */
439 +<style data-sn-service-navigator-master="1">
440 +/* =========================================================
441 + MASTER TYPOGRAPHY
442 + ========================================================= */
434 434  #xwikicontent h1,
435 435  #xwikicontent h2,
436 436  #xwikicontent h3,
... ... @@ -452,88 +452,105 @@
452 452   word-spacing:normal!important;
453 453  }
454 454  
455 -/* ---------- Native XWiki semantic callouts ---------- */
456 -#xwikicontent .box.infomessage,
457 -#xwikicontent .infomessage,
458 -#xwikicontent .box.warningmessage,
459 -#xwikicontent .warningmessage,
460 -#xwikicontent .box.successmessage,
461 -#xwikicontent .successmessage,
462 -#xwikicontent .box.errormessage,
463 -#xwikicontent .errormessage,
464 -#xwikicontent [data-sn-callout-harmonized="1"]{
464 +/* =========================================================
465 + COMING SOON / IN VORBEREITUNG
466 + ========================================================= */
467 +.sn-coming-soon-badge{
468 + display:inline-block;
469 + vertical-align:middle;
470 + margin-left:10px;
471 + padding:4px 8px;
472 + border-radius:14px;
473 + border:1px solid #efd9cc;
474 + background:#fff4ee;
475 + color:#8a4d36;
476 + font-size:11px;
477 + font-weight:700;
478 + letter-spacing:.055em;
479 + line-height:1.2;
480 + white-space:nowrap;
481 +}
482 +
483 +/* =========================================================
484 + NATIVE / DETAIL CALLOUT GEOMETRY
485 + Preserve existing backgrounds.
486 + ========================================================= */
487 +#xwikicontent .arsn-info,
488 +#xwikicontent .dmp-info,
489 +#xwikicontent .ido-info,
490 +#xwikicontent .pp-info,
491 +#xwikicontent .infomessage{
465 465   box-sizing:border-box!important;
466 - border-radius:8px!important;
467 - border-top:1px solid rgba(0,0,0,.08)!important;
468 - border-right:1px solid rgba(0,0,0,.08)!important;
469 - border-bottom:1px solid rgba(0,0,0,.08)!important;
470 - border-left:4px solid var(--sn-callout-accent,#21b6d7)!important;
471 - padding:14px 16px!important;
493 + border-left:4px solid #21b6d7!important;
494 + border-radius:8px;
472 472   text-align:left!important;
473 - text-justify:auto!important;
474 474   word-spacing:normal!important;
475 - box-shadow:none!important;
476 476  }
477 477  
478 -#xwikicontent .box.infomessage,
479 -#xwikicontent .infomessage{
480 - --sn-callout-accent:#21b6d7;
481 - background:#eaf7fb!important;
482 -}
483 -
484 -#xwikicontent .box.warningmessage,
485 -#xwikicontent .warningmessage{
486 - --sn-callout-accent:#f0aa00;
487 - background:#fff8e7!important;
488 -}
489 -
490 -#xwikicontent .box.successmessage,
491 -#xwikicontent .successmessage{
492 - --sn-callout-accent:#38b76a;
493 - background:#edf9f1!important;
494 -}
495 -
496 -#xwikicontent .box.errormessage,
499 +#xwikicontent .arsn-warn,
500 +#xwikicontent .dmp-warn,
501 +#xwikicontent .ido-warn,
502 +#xwikicontent .pp-warn,
503 +#xwikicontent .warn,
504 +#xwikicontent .warning,
505 +#xwikicontent .warningmessage,
497 497  #xwikicontent .errormessage{
498 - --sn-callout-accent:#e94b13;
499 - background:#fff1ec!important;
507 + box-sizing:border-box!important;
508 + border-left:4px solid #e94b13!important;
509 + border-radius:8px;
510 + text-align:left!important;
511 + word-spacing:normal!important;
500 500  }
501 501  
502 -#xwikicontent [data-sn-callout-harmonized="1"] > :first-child,
503 -#xwikicontent .infomessage > :first-child,
504 -#xwikicontent .warningmessage > :first-child,
505 -#xwikicontent .successmessage > :first-child,
506 -#xwikicontent .errormessage > :first-child{
507 - margin-top:0!important;
514 +[data-sn-master-equal-height],
515 +[data-sn-master-first-row]{
516 + box-sizing:border-box;
508 508  }
509 509  
510 -#xwikicontent [data-sn-callout-harmonized="1"] > :last-child,
511 -#xwikicontent .infomessage > :last-child,
512 -#xwikicontent .warningmessage > :last-child,
513 -#xwikicontent .successmessage > :last-child,
514 -#xwikicontent .errormessage > :last-child{
515 - margin-bottom:0!important;
519 +/* =========================================================
520 + FULL-WIDTH THREE-LINE NUMBER / TITLE / SUBTITLE BLOCKS
521 + ========================================================= */
522 +#xwikicontent .arsn-area-label[data-sn-three-line="1"]{
523 + display:grid!important;
524 + grid-template-columns:minmax(0,1fr)!important;
525 + grid-auto-rows:auto!important;
526 + width:100%!important;
527 + max-width:none!important;
528 + box-sizing:border-box!important;
529 + justify-items:start!important;
530 + align-items:start!important;
531 + gap:2px!important;
532 + text-align:left!important;
533 + text-align-last:left!important;
534 + text-justify:auto!important;
535 + word-spacing:normal!important;
536 + white-space:normal!important;
516 516  }
517 -
518 -#xwikicontent [data-sn-equal-height-managed],
519 -#xwikicontent [data-sn-first-section-aligned],
520 -#xwikicontent [data-sn-first-content-aligned]{
521 - box-sizing:border-box;
538 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-number,
539 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .sn-area-label-title,
540 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-action{
541 + display:block!important;
542 + width:100%!important;
543 + margin:0!important;
544 + text-align:left!important;
545 + text-align-last:left!important;
546 + text-justify:auto!important;
547 + word-spacing:normal!important;
548 + white-space:normal!important;
522 522  }
523 523  </style>
524 524  
525 -<script data-sn-horizontal-box-harmonizer="7">
552 +<script data-sn-service-navigator-master="1">
526 526  (function(){
527 527   "use strict";
528 528  
556 + var PAGE_KIND="detail";
557 + var PLACEHOLDER=false;
558 + var PLACEHOLDER_LABEL="COMING SOON";
559 +
529 529   var MOBILE_MAX=767;
530 530   var ROW_TOLERANCE=6;
531 - var MIN_W=150;
532 - var MIN_H=36;
533 - var MAX_PARENT_CHILDREN=18;
534 - var SEARCH_DEPTH=5;
535 535   var RESIZE_DEBOUNCE=220;
536 - var MIN_WIDTH_CHANGE=2;
537 537  
538 538   var root=
539 539   document.getElementById("xwikicontent")||
... ... @@ -543,142 +543,114 @@
543 543  
544 544   if(!root)return;
545 545  
546 - var heightManaged=new Set();
547 - var sectionManaged=new Set();
548 - var contentManaged=new Set();
572 + var managedHeight=new Set();
573 + var managedMargin=new Set();
574 + var originalHeight=new WeakMap();
575 + var originalMargin=new WeakMap();
549 549  
550 - var originalMinHeight=new WeakMap();
551 - var originalMarginTop=new WeakMap();
552 -
553 553   var resizeTimer=0;
554 - var lastWidth=-1;
555 - var hasApplied=false;
556 - var applying=false;
578 + var running=false;
557 557  
558 - function num(v){
559 - var n=parseFloat(v);
560 - return Number.isFinite(n)?n:0;
561 - }
562 -
563 - function visible(el,minW,minH){
564 - if(!el||el.nodeType!==1)return false;
565 -
566 - var s=getComputedStyle(el);
567 -
568 - if(
569 - s.display==="none"||
570 - s.visibility==="hidden"||
571 - Number(s.opacity)===0
572 - ){
573 - return false;
580 + var THEMES=[
581 + {
582 + name:"BLUE",
583 + accent:"#21b6d7",
584 + bg:"#eaf7fb",
585 + text:"#315d68",
586 + labels:[
587 + "HIER STARTEN",
588 + "ENTSCHEIDEN",
589 + "ÜBERPRÜFEN & ANPASSEN",
590 + "START HERE",
591 + "DECIDE",
592 + "REVIEW & ADAPT"
593 + ]
594 + },
595 + {
596 + name:"RED",
597 + accent:"#e94b13",
598 + bg:"#fff1ec",
599 + text:"#8a4d36",
600 + labels:[
601 + "PLANEN & ORGANISIEREN",
602 + "ORGANISIEREN & DOKUMENTIEREN",
603 + "PUBLIZIEREN & PRÄSENTIEREN",
604 + "PLAN & ORGANISE",
605 + "PLAN & ORGANIZE",
606 + "ORGANISE & DOCUMENT",
607 + "ORGANIZE & DOCUMENT",
608 + "PUBLISH & PRESENT"
609 + ]
610 + },
611 + {
612 + name:"YELLOW",
613 + accent:"#f0aa00",
614 + bg:"#fff8e7",
615 + text:"#785b17",
616 + labels:[
617 + "SCHÜTZEN & KLÄREN",
618 + "STANDARDISIEREN & IDENTIFIZIEREN",
619 + "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN",
620 + "PROTECT & CLARIFY",
621 + "STANDARDISE & IDENTIFY",
622 + "STANDARDIZE & IDENTIFY",
623 + "OPEN, REUSE & MAKE FINDABLE"
624 + ]
625 + },
626 + {
627 + name:"GREEN",
628 + accent:"#38b76a",
629 + bg:"#edf9f1",
630 + text:"#3f7451",
631 + labels:[
632 + "INFRASTRUKTUR EINRICHTEN",
633 + "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN",
634 + "SPEICHERN & ZUGRIFF STEUERN",
635 + "REPOSITORIUM, ERHALTEN & ÜBERGEBEN",
636 + "SET UP INFRASTRUCTURE",
637 + "SET UP INFRASTRUCTURE & COLLABORATION",
638 + "STORE & CONTROL ACCESS",
639 + "REPOSITORY, PRESERVE & HAND OVER"
640 + ]
574 574   }
642 + ];
575 575  
576 - var r=el.getBoundingClientRect();
577 -
578 - return (
579 - r.width>=(minW||1)&&
580 - r.height>=(minH||1)
581 - );
644 + function num(value){
645 + var n=parseFloat(value);
646 + return Number.isFinite(n)?n:0;
582 582   }
583 583  
584 - function normalizeText(text){
585 - return String(text||"")
649 + function norm(value){
650 + return String(value||"")
586 586   .replace(/\s+/g," ")
587 587   .trim()
588 588   .toUpperCase();
589 589   }
590 590  
591 - function excluded(el){
592 - return (
593 - !el.matches||
594 - el.matches(
595 - "button,input,select,textarea,option,label,img,svg,canvas,table,thead,tbody,tfoot,tr,td,th,summary,script,style,noscript,template,.btn,.chip,[role=button]"
596 - )
597 - );
598 - }
656 + function visible(el){
657 + if(!el||el.nodeType!==1)return false;
599 599  
600 - /* ---------- Custom coloured callouts ---------- */
659 + var style=getComputedStyle(el);
660 + var rect=el.getBoundingClientRect();
601 601  
602 - function nativeCallout(el){
603 - var c=
604 - typeof el.className==="string"
605 - ? el.className.toLowerCase()
606 - : "";
607 -
608 608   return (
609 - /(^|\s)(infomessage|warningmessage|successmessage|errormessage)(\s|$)/.test(c)
663 + style.display!=="none"&&
664 + style.visibility!=="hidden"&&
665 + rect.width>20&&
666 + rect.height>4
610 610   );
611 611   }
612 612  
613 - function customCallout(el){
614 - if(!visible(el,220,42)||excluded(el))return false;
615 -
616 - var r=el.getBoundingClientRect();
617 -
618 - if(r.height>520)return false;
619 -
620 - var s=getComputedStyle(el);
621 -
622 - var bg=
623 - s.backgroundColor&&
624 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
625 - s.backgroundColor!=="transparent"&&
626 - s.backgroundColor!=="rgb(255, 255, 255)";
627 -
628 - var left=
629 - num(s.borderLeftWidth);
630 -
631 - return (
632 - bg&&
633 - left>=2
634 - );
635 - }
636 -
637 - function harmoniseCustomCallouts(){
638 - Array.from(
639 - root.querySelectorAll(
640 - "div,aside,section"
641 - )
642 - ).forEach(function(el){
643 - if(nativeCallout(el))return;
644 - if(!customCallout(el))return;
645 -
646 - var s=getComputedStyle(el);
647 -
648 - el.setAttribute(
649 - "data-sn-callout-harmonized",
650 - "1"
651 - );
652 -
653 - if(
654 - s.borderLeftColor
655 - ){
656 - el.style.setProperty(
657 - "--sn-callout-accent",
658 - s.borderLeftColor
659 - );
660 - }
661 - });
662 - }
663 -
664 - /* ---------- Restore only values V7 itself changed ---------- */
665 -
666 - function saveOriginal(el,map,property){
670 + function saveStyle(el,map,property){
667 667   if(map.has(el))return;
668 668  
669 669   map.set(el,{
670 - value:
671 - el.style.getPropertyValue(
672 - property
673 - ),
674 - priority:
675 - el.style.getPropertyPriority(
676 - property
677 - )
674 + value:el.style.getPropertyValue(property),
675 + priority:el.style.getPropertyPriority(property)
678 678   });
679 679   }
680 680  
681 - function restoreOriginal(el,map,property){
679 + function restoreStyle(el,map,property){
682 682   var original=map.get(el);
683 683  
684 684   if(original&&original.value){
... ... @@ -688,770 +688,1069 @@
688 688   original.priority||""
689 689   );
690 690   }else{
691 - el.style.removeProperty(
692 - property
693 - );
689 + el.style.removeProperty(property);
694 694   }
695 695   }
696 696  
697 697   function resetRuntime(){
698 - heightManaged.forEach(function(el){
699 - restoreOriginal(
694 + managedHeight.forEach(function(el){
695 + restoreStyle(
700 700   el,
701 - originalMinHeight,
697 + originalHeight,
702 702   "min-height"
703 703   );
704 -
705 705   el.removeAttribute(
706 - "data-sn-equal-height-managed"
701 + "data-sn-master-equal-height"
707 707   );
708 708   });
709 709  
710 - sectionManaged.forEach(function(el){
711 - restoreOriginal(
705 + managedMargin.forEach(function(el){
706 + restoreStyle(
712 712   el,
713 - originalMarginTop,
708 + originalMargin,
714 714   "margin-top"
715 715   );
716 -
717 717   el.removeAttribute(
718 - "data-sn-first-section-aligned"
712 + "data-sn-master-first-row"
719 719   );
720 720   });
721 721  
722 - contentManaged.forEach(function(el){
723 - restoreOriginal(
724 - el,
725 - originalMarginTop,
726 - "margin-top"
727 - );
716 + managedHeight.clear();
717 + managedMargin.clear();
718 + }
728 728  
729 - el.removeAttribute(
730 - "data-sn-first-content-aligned"
731 - );
732 - });
720 + function themeFor(text){
721 + var value=norm(text);
733 733  
734 - heightManaged.clear();
735 - sectionManaged.clear();
736 - contentManaged.clear();
737 - }
723 + for(var i=0;i<THEMES.length;i++){
724 + for(var j=0;j<THEMES[i].labels.length;j++){
725 + var label=THEMES[i].labels[j];
738 738  
739 - /* ---------- Card detection ---------- */
727 + if(
728 + value===label||
729 + value.indexOf(label+" ")===0||
730 + value.indexOf(label+" -")===0||
731 + value.indexOf(label+" ·")===0
732 + ){
733 + return THEMES[i];
734 + }
735 + }
736 + }
740 740  
741 - function namedLikeBox(el){
742 - var c=
743 - typeof el.className==="string"
744 - ? el.className
745 - : "";
738 + return null;
739 + }
746 746  
747 - return /(^|[\s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([\s_-]|$)/i.test(c);
741 + /* =======================================================
742 + BORDERLESS FILLED RED/ORANGE CTA BUTTONS
743 + ======================================================= */
744 +
745 + function colourDistance(a,b){
746 + return Math.sqrt(
747 + Math.pow(a[0]-b[0],2)+
748 + Math.pow(a[1]-b[1],2)+
749 + Math.pow(a[2]-b[2],2)
750 + );
748 748   }
749 749  
750 - function boxLike(el){
751 - if(
752 - !visible(el,MIN_W,MIN_H)||
753 - excluded(el)
754 - ){
755 - return false;
756 - }
753 + function makeFilledRedOrangeCTAsBorderless(){
754 + var RED_ORANGE=[233,75,19];
757 757  
758 - var s=getComputedStyle(el);
759 - var r=el.getBoundingClientRect();
756 + Array.from(
757 + root.querySelectorAll(
758 + 'a,button,[role="button"],input[type="submit"],input[type="button"]'
759 + )
760 + ).forEach(function(el){
761 + if(!visible(el))return;
760 760  
761 - var border=
762 - num(s.borderTopWidth)+
763 - num(s.borderRightWidth)+
764 - num(s.borderBottomWidth)+
765 - num(s.borderLeftWidth);
763 + var style=getComputedStyle(el);
764 + var rgb=parseRGB(style.backgroundColor);
766 766  
767 - var radius=Math.max(
768 - num(s.borderTopLeftRadius),
769 - num(s.borderTopRightRadius),
770 - num(s.borderBottomLeftRadius),
771 - num(s.borderBottomRightRadius)
772 - );
766 + if(!rgb)return;
773 773  
774 - var bg=
775 - s.backgroundColor&&
776 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
777 - s.backgroundColor!=="transparent";
768 + if(
769 + colourDistance(
770 + rgb,
771 + RED_ORANGE
772 + )>55
773 + ){
774 + return;
775 + }
778 778  
779 - var shadow=
780 - s.boxShadow&&
781 - s.boxShadow!=="none";
777 + var rect=el.getBoundingClientRect();
782 782  
783 - return (
784 - namedLikeBox(el)||
785 - border>=1||
786 - (bg&&radius>=3)||
787 - (shadow&&r.width>=180)
788 - );
789 - }
779 + if(
780 + rect.width<80||
781 + rect.height<24
782 + ){
783 + return;
784 + }
790 790  
791 - function pickTarget(child){
792 - if(!visible(child,MIN_W,MIN_H))return null;
786 + el.style.setProperty(
787 + "border",
788 + "none",
789 + "important"
790 + );
793 793  
794 - if(boxLike(child))return child;
792 + el.style.setProperty(
793 + "border-left",
794 + "none",
795 + "important"
796 + );
795 795  
796 - var cr=child.getBoundingClientRect();
797 - var q=[];
798 + el.style.setProperty(
799 + "border-top",
800 + "none",
801 + "important"
802 + );
798 798  
799 - Array.from(child.children||[]).forEach(function(el){
800 - q.push({el:el,depth:1});
804 + el.style.setProperty(
805 + "border-right",
806 + "none",
807 + "important"
808 + );
809 +
810 + el.style.setProperty(
811 + "border-bottom",
812 + "none",
813 + "important"
814 + );
815 +
816 + el.style.setProperty(
817 + "box-shadow",
818 + "none",
819 + "important"
820 + );
801 801   });
822 + }
802 802  
803 - var best=null;
804 - var bestScore=-Infinity;
824 + /* =======================================================
825 + FULL-WIDTH THREE-LINE AREA LABELS
826 + ======================================================= */
805 805  
806 - while(q.length){
807 - var item=q.shift();
808 - var el=item.el;
828 + function compactText(value){
829 + return String(value||"")
830 + .replace(/\s+/g," ")
831 + .trim();
832 + }
809 809  
810 - if(!visible(el,MIN_W,MIN_H))continue;
834 + function makeThreeLineAreaLabels(){
835 + Array.from(
836 + root.querySelectorAll(
837 + ".arsn-area-label"
838 + )
839 + ).forEach(function(label){
840 + if(
841 + label.getAttribute(
842 + "data-sn-three-line"
843 + )==="1"
844 + ){
845 + return;
846 + }
811 811  
812 - var r=el.getBoundingClientRect();
848 + var number=
849 + label.querySelector(
850 + ":scope > .arsn-area-number"
851 + );
813 813  
853 + var action=
854 + label.querySelector(
855 + ":scope > .arsn-area-action"
856 + );
857 +
814 814   if(
815 - r.width>=cr.width*.68&&
816 - boxLike(el)
859 + !number||
860 + !action
817 817   ){
818 - var widthFit=
819 - 1-Math.min(
820 - 1,
821 - Math.abs(cr.width-r.width)/
822 - Math.max(1,cr.width)
823 - );
862 + return;
863 + }
824 824  
825 - var topFit=
826 - 1-Math.min(
827 - 1,
828 - Math.abs(cr.top-r.top)/100
829 - );
865 + var clone=
866 + label.cloneNode(true);
830 830  
831 - var score=
832 - widthFit*6+
833 - topFit*3+
834 - Math.min(r.height,900)/450+
835 - Math.min(r.width*r.height,900000)/900000;
868 + var cloneNumber=
869 + clone.querySelector(
870 + ":scope > .arsn-area-number"
871 + );
836 836  
837 - if(score>bestScore){
838 - best=el;
839 - bestScore=score;
840 - }
873 + var cloneAction=
874 + clone.querySelector(
875 + ":scope > .arsn-area-action"
876 + );
877 +
878 + if(cloneNumber){
879 + cloneNumber.remove();
841 841   }
842 842  
843 - if(item.depth<SEARCH_DEPTH){
844 - Array.from(el.children||[]).forEach(function(next){
845 - q.push({
846 - el:next,
847 - depth:item.depth+1
848 - });
849 - });
882 + if(cloneAction){
883 + cloneAction.remove();
850 850   }
851 - }
852 852  
853 - return best;
854 - }
886 + var titleText=
887 + compactText(
888 + clone.textContent
889 + );
855 855  
856 - function groupRows(entries){
857 - var groups=[];
891 + if(!titleText){
892 + return;
893 + }
858 858  
859 - entries
860 - .slice()
861 - .sort(function(a,b){
862 - return (
863 - a.rect.top-b.rect.top||
864 - a.rect.left-b.rect.left
895 + var numberNode=
896 + number.cloneNode(true);
897 +
898 + var actionNode=
899 + action.cloneNode(true);
900 +
901 + var titleNode=
902 + document.createElement(
903 + "span"
865 865   );
866 - })
867 - .forEach(function(entry){
868 - var group=null;
869 869  
870 - for(var i=0;i<groups.length;i++){
871 - if(
872 - Math.abs(
873 - groups[i].top-
874 - entry.rect.top
875 - )<=ROW_TOLERANCE
876 - ){
877 - group=groups[i];
878 - break;
879 - }
880 - }
906 + titleNode.className=
907 + "sn-area-label-title";
881 881  
882 - if(!group){
883 - group={
884 - top:entry.rect.top,
885 - entries:[]
886 - };
887 - groups.push(group);
888 - }
909 + titleNode.textContent=
910 + titleText;
889 889  
890 - group.entries.push(entry);
891 - });
912 + while(label.firstChild){
913 + label.removeChild(
914 + label.firstChild
915 + );
916 + }
892 892  
893 - return groups;
918 + label.appendChild(
919 + numberNode
920 + );
921 +
922 + label.appendChild(
923 + titleNode
924 + );
925 +
926 + label.appendChild(
927 + actionNode
928 + );
929 +
930 + label.setAttribute(
931 + "data-sn-three-line",
932 + "1"
933 + );
934 +
935 + var head=
936 + label.closest(
937 + ".arsn-area-head"
938 + );
939 +
940 + if(head){
941 + head.style.setProperty(
942 + "width",
943 + "100%",
944 + "important"
945 + );
946 +
947 + head.style.setProperty(
948 + "max-width",
949 + "100%",
950 + "important"
951 + );
952 +
953 + head.style.setProperty(
954 + "box-sizing",
955 + "border-box",
956 + "important"
957 + );
958 + }
959 + });
894 894   }
895 895  
896 - function validRow(group){
897 - if(group.entries.length<2)return false;
962 + /* =======================================================
963 + PLACEHOLDER BADGE
964 + ======================================================= */
898 898  
899 - var lefts=
900 - group.entries
901 - .map(function(e){return e.rect.left;})
902 - .sort(function(a,b){return a-b;});
966 + function applyPlaceholderBadge(){
967 + if(!PLACEHOLDER)return;
903 903  
904 904   if(
905 - lefts[lefts.length-1]-
906 - lefts[0]<
907 - 80
970 + document.querySelector(
971 + ".sn-coming-soon-badge"
972 + )
908 908   ){
909 - return false;
974 + return;
910 910   }
911 911  
912 - var widths=
913 - group.entries
914 - .map(function(e){return e.rect.width;})
915 - .filter(function(w){return w>0;});
977 + var title=
978 + document.querySelector(
979 + "#document-title"
980 + )||
981 + document.querySelector(
982 + "h1"
983 + );
916 916  
917 - if(widths.length<2)return false;
985 + if(!title)return;
918 918  
919 - var minW=
920 - Math.min.apply(Math,widths);
987 + var badge=
988 + document.createElement(
989 + "span"
990 + );
921 921  
922 - var maxW=
923 - Math.max.apply(Math,widths);
992 + badge.className=
993 + "sn-coming-soon-badge";
924 924  
925 - return (
926 - maxW/
927 - Math.max(1,minW)<=
928 - 1.9
995 + badge.textContent=
996 + PLACEHOLDER_LABEL;
997 +
998 + badge.setAttribute(
999 + "aria-label",
1000 + PLACEHOLDER_LABEL
929 929   );
930 - }
931 931  
932 - /* ---------- Known ARSN first section bars ---------- */
933 -
934 - function knownBar(el){
935 - var text=
936 - normalizeText(
937 - el.textContent
938 - );
939 -
940 - return (
941 - text==="HIER STARTEN"||
942 - text==="ORGANISIEREN & DOKUMENTIEREN"||
943 - text==="ENTSCHEIDEN"||
944 - text==="START HERE"||
945 - text==="GET STARTED"||
946 - text==="ORGANISE & DOCUMENT"||
947 - text==="ORGANIZE & DOCUMENT"||
948 - text==="DECIDE"
1003 + title.appendChild(
1004 + badge
949 949   );
950 950   }
951 951  
952 - function findKnownBar(card){
953 - var cardRect=
954 - card.getBoundingClientRect();
1008 + /* =======================================================
1009 + DETAIL PAGE OWN-ACCENT PROPAGATION
1010 + ======================================================= */
955 955  
956 - var rows=
957 - Array.from(
958 - card.querySelectorAll(
959 - "div,p,span,strong,h3,h4,h5,h6"
960 - )
961 - )
962 - .filter(function(el){
963 - if(!visible(el,20,6))return false;
964 - if(!knownBar(el))return false;
1012 + function parseRGB(value){
1013 + var match=String(value||"").match(
1014 + /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
1015 + );
965 965  
966 - var r=el.getBoundingClientRect();
1017 + if(!match)return null;
967 967  
968 - var rel=
969 - r.top-
970 - cardRect.top;
1019 + return [
1020 + Number(match[1]),
1021 + Number(match[2]),
1022 + Number(match[3])
1023 + ];
1024 + }
971 971  
972 - return (
973 - rel>=35&&
974 - rel<=
975 - cardRect.height*.75
976 - );
977 - })
978 - .sort(function(a,b){
979 - return (
980 - a.getBoundingClientRect().top-
981 - b.getBoundingClientRect().top
982 - );
983 - });
984 -
985 - return rows[0]||null;
1026 + function distance(a,b){
1027 + return Math.sqrt(
1028 + Math.pow(a[0]-b[0],2)+
1029 + Math.pow(a[1]-b[1],2)+
1030 + Math.pow(a[2]-b[2],2)
1031 + );
986 986   }
987 987  
988 - function alignKnownBars(cards){
989 - var rows=
990 - cards.map(function(card){
991 - var bar=
992 - findKnownBar(card);
1034 + function paletteMatch(cssColor){
1035 + var rgb=parseRGB(cssColor);
993 993  
994 - if(!bar)return null;
1037 + if(!rgb)return null;
995 995  
996 - var cr=
997 - card.getBoundingClientRect();
1039 + var palette=[
1040 + {hex:"#21b6d7",rgb:[33,182,215]},
1041 + {hex:"#e94b13",rgb:[233,75,19]},
1042 + {hex:"#f0aa00",rgb:[240,170,0]},
1043 + {hex:"#38b76a",rgb:[56,183,106]}
1044 + ];
998 998  
999 - var br=
1000 - bar.getBoundingClientRect();
1046 + var best=null;
1047 + var bestDistance=Infinity;
1001 1001  
1002 - return {
1003 - bar:bar,
1004 - relativeTop:
1005 - br.top-
1006 - cr.top
1007 - };
1008 - });
1049 + palette.forEach(function(item){
1050 + var d=distance(rgb,item.rgb);
1009 1009  
1010 - if(
1011 - rows.some(function(row){
1012 - return !row;
1013 - })
1014 - ){
1015 - return false;
1016 - }
1052 + if(d<bestDistance){
1053 + best=item;
1054 + bestDistance=d;
1055 + }
1056 + });
1017 1017  
1018 - var target=
1019 - Math.max.apply(
1020 - Math,
1021 - rows.map(function(row){
1022 - return row.relativeTop;
1023 - })
1024 - );
1058 + return bestDistance<=30
1059 + ?best
1060 + :null;
1061 + }
1025 1025  
1026 - rows.forEach(function(row){
1027 - var delta=
1028 - target-
1029 - row.relativeTop;
1063 + function propagateDetailAccents(){
1064 + if(PAGE_KIND!=="detail")return;
1030 1030  
1031 - if(delta<=1)return;
1066 + Array.from(
1067 + root.querySelectorAll(
1068 + ".arsn-call,.dmp-call,.ido-call,.pp-call,"+
1069 + ".arsn-source,.dmp-source,.ido-source,.pp-source"
1070 + )
1071 + ).forEach(function(el){
1072 + if(!visible(el))return;
1032 1032  
1033 - saveOriginal(
1034 - row.bar,
1035 - originalMarginTop,
1036 - "margin-top"
1037 - );
1074 + var style=getComputedStyle(el);
1038 1038  
1039 - var current=
1040 - num(
1041 - getComputedStyle(
1042 - row.bar
1043 - ).marginTop
1044 - );
1076 + if(
1077 + num(style.borderTopWidth)>=2
1078 + ){
1079 + var match=
1080 + paletteMatch(
1081 + style.borderTopColor
1082 + );
1045 1045  
1046 - row.bar.style.setProperty(
1047 - "margin-top",
1048 - (
1049 - current+
1050 - delta
1051 - )+"px"
1052 - );
1084 + if(match){
1085 + el.style.setProperty(
1086 + "border-left",
1087 + "4px solid "+match.hex,
1088 + "important"
1089 + );
1090 + }
1091 + }
1092 + });
1053 1053  
1054 - row.bar.setAttribute(
1055 - "data-sn-first-section-aligned",
1056 - "7"
1057 - );
1094 + // Warning families: explicit safety override.
1095 + Array.from(
1096 + root.querySelectorAll(
1097 + ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+
1098 + ".warn,.warning,.warningmessage,.errormessage"
1099 + )
1100 + ).forEach(function(el){
1101 + if(!visible(el))return;
1058 1058  
1059 - sectionManaged.add(
1060 - row.bar
1103 + el.style.setProperty(
1104 + "border-left",
1105 + "4px solid #e94b13",
1106 + "important"
1061 1061   );
1062 1062   });
1063 1063  
1064 - return true;
1110 + // Info families: explicit orientation override.
1111 + Array.from(
1112 + root.querySelectorAll(
1113 + ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage"
1114 + )
1115 + ).forEach(function(el){
1116 + if(!visible(el))return;
1117 +
1118 + el.style.setProperty(
1119 + "border-left",
1120 + "4px solid #21b6d7",
1121 + "important"
1122 + );
1123 + });
1065 1065   }
1066 1066  
1067 - /* ---------- Generic first content after heading ---------- */
1126 + /* =======================================================
1127 + OVERVIEW SEMANTIC THEME PALETTE
1128 + ======================================================= */
1068 1068  
1069 - function heading(card){
1070 - var cr=
1071 - card.getBoundingClientRect();
1072 -
1073 - var rows=
1074 - Array.from(
1075 - card.querySelectorAll(
1076 - "h1,h2,h3,h4,h5,h6,.box-title,[role=heading]"
1077 - )
1130 + function smallestThemeHeaders(){
1131 + return Array.from(
1132 + root.querySelectorAll(
1133 + "div,span,p,strong,h3,h4,h5,h6"
1078 1078   )
1079 - .filter(function(el){
1080 - if(!visible(el,20,8))return false;
1135 + ).filter(function(el){
1136 + if(!visible(el))return false;
1137 + if(!themeFor(el.textContent))return false;
1081 1081  
1082 - var r=el.getBoundingClientRect();
1083 -
1084 - var rel=
1085 - r.top-
1086 - cr.top;
1087 -
1088 - return (
1089 - rel>=0&&
1090 - rel<=
1091 - Math.min(
1092 - 160,
1093 - cr.height*.45
1094 - )
1139 + return !Array.from(
1140 + el.children||[]
1141 + ).some(function(child){
1142 + return !!themeFor(
1143 + child.textContent
1095 1095   );
1096 - })
1097 - .sort(function(a,b){
1098 - return (
1099 - a.getBoundingClientRect().top-
1100 - b.getBoundingClientRect().top
1101 - );
1102 1102   });
1103 -
1104 - return rows[0]||null;
1146 + });
1105 1105   }
1106 1106  
1107 - function firstContent(card,h){
1108 - if(!h)return null;
1149 + function findOverviewCard(header){
1150 + var node=header.parentElement;
1151 + var candidates=[];
1109 1109  
1110 - var cr=
1111 - card.getBoundingClientRect();
1153 + while(node&&node!==root){
1154 + var rect=node.getBoundingClientRect();
1155 + var style=getComputedStyle(node);
1112 1112  
1113 - var hr=
1114 - h.getBoundingClientRect();
1157 + var border=
1158 + num(style.borderTopWidth)+
1159 + num(style.borderRightWidth)+
1160 + num(style.borderBottomWidth)+
1161 + num(style.borderLeftWidth);
1115 1115  
1116 - var rows=
1117 - Array.from(
1118 - card.querySelectorAll(
1119 - "p,div,ul,ol,dl,blockquote"
1120 - )
1121 - )
1122 - .filter(function(el){
1123 - if(
1124 - el===h||
1125 - h.contains(el)||
1126 - el.contains(h)
1127 - ){
1128 - return false;
1129 - }
1163 + if(
1164 + rect.width>=220&&
1165 + rect.width<=800&&
1166 + rect.height>=120&&
1167 + border>=1
1168 + ){
1169 + candidates.push(node);
1170 + }
1130 1130  
1131 - if(!visible(el,30,8))return false;
1172 + node=node.parentElement;
1173 + }
1132 1132  
1133 - var text=
1134 - String(el.textContent||"")
1135 - .replace(/\s+/g," ")
1136 - .trim();
1175 + if(!candidates.length)return null;
1137 1137  
1138 - if(text.length<3)return false;
1177 + candidates.sort(function(a,b){
1178 + return (
1179 + b.getBoundingClientRect().height-
1180 + a.getBoundingClientRect().height
1181 + );
1182 + });
1139 1139  
1140 - var r=el.getBoundingClientRect();
1184 + return candidates[0];
1185 + }
1141 1141  
1142 - if(
1143 - r.top<
1144 - hr.bottom-1
1145 - ){
1146 - return false;
1147 - }
1187 + function rowCandidates(link,card){
1188 + var result=[];
1189 + var cardRect=
1190 + card.getBoundingClientRect();
1148 1148  
1149 - if(
1150 - r.top-cr.top>
1151 - Math.min(
1152 - 280,
1153 - cr.height*.65
1154 - )
1155 - ){
1156 - return false;
1157 - }
1192 + var node=link;
1158 1158  
1194 + while(node&&node!==card){
1195 + if(visible(node)){
1196 + var rect=
1197 + node.getBoundingClientRect();
1198 +
1159 1159   if(
1160 - r.height>
1161 - cr.height*.58
1200 + rect.height<=105&&
1201 + rect.width>=
1202 + cardRect.width*.50&&
1203 + rect.width<=
1204 + cardRect.width*1.03
1162 1162   ){
1163 - return false;
1206 + result.push(node);
1164 1164   }
1208 + }
1165 1165  
1166 - return true;
1167 - })
1168 - .sort(function(a,b){
1169 - var ar=
1170 - a.getBoundingClientRect();
1210 + node=node.parentElement;
1211 + }
1171 1171  
1172 - var br=
1173 - b.getBoundingClientRect();
1213 + return result;
1214 + }
1174 1174  
1216 + function chooseOuterRow(
1217 + candidates,
1218 + link
1219 + ){
1220 + if(!candidates.length){
1221 + return link;
1222 + }
1223 +
1224 + var bordered=
1225 + candidates.filter(function(el){
1175 1175   return (
1176 - ar.top-br.top||
1177 - ar.height-br.height
1227 + num(
1228 + getComputedStyle(el)
1229 + .borderLeftWidth
1230 + )>=1
1178 1178   );
1179 1179   });
1180 1180  
1181 - return rows[0]||null;
1182 - }
1234 + var pool=
1235 + bordered.length
1236 + ?bordered
1237 + :candidates;
1183 1183  
1184 - function alignGeneric(cards){
1185 - var rows=
1186 - cards.map(function(card){
1187 - var h=
1188 - heading(card);
1239 + pool.sort(function(a,b){
1240 + var ar=
1241 + a.getBoundingClientRect();
1189 1189  
1190 - var c=
1191 - firstContent(
1192 - card,
1193 - h
1194 - );
1243 + var br=
1244 + b.getBoundingClientRect();
1195 1195  
1196 - if(!h||!c)return null;
1246 + return (
1247 + ar.left-br.left||
1248 + br.width-ar.width
1249 + );
1250 + });
1197 1197  
1198 - var cr=
1199 - card.getBoundingClientRect();
1252 + return pool[0]||link;
1253 + }
1200 1200  
1201 - var rr=
1202 - c.getBoundingClientRect();
1203 -
1204 - return {
1205 - content:c,
1206 - relativeTop:
1207 - rr.top-cr.top
1208 - };
1209 - });
1210 -
1211 - if(
1212 - rows.some(function(row){
1213 - return !row;
1214 - })
1215 - ){
1216 - return false;
1255 + function applyOverviewPalette(){
1256 + if(PAGE_KIND!=="overview"){
1257 + return [];
1217 1217   }
1218 1218  
1219 - var target=
1220 - Math.max.apply(
1221 - Math,
1222 - rows.map(function(row){
1223 - return row.relativeTop;
1260 + var headers=
1261 + smallestThemeHeaders()
1262 + .map(function(el){
1263 + return {
1264 + el:el,
1265 + theme:
1266 + themeFor(
1267 + el.textContent
1268 + ),
1269 + card:
1270 + findOverviewCard(
1271 + el
1272 + )
1273 + };
1224 1224   })
1225 - );
1275 + .filter(function(row){
1276 + return !!row.card;
1277 + });
1226 1226  
1227 - rows.forEach(function(row){
1228 - var delta=
1229 - target-
1230 - row.relativeTop;
1279 + var unique=[];
1280 + var seenHeaders=new Set();
1231 1231  
1232 - if(delta<=1)return;
1282 + headers.forEach(function(row){
1283 + var key=
1284 + row.theme.name+
1285 + "|"+
1286 + Math.round(
1287 + row.card
1288 + .getBoundingClientRect()
1289 + .left
1290 + )+
1291 + "|"+
1292 + Math.round(
1293 + row.el
1294 + .getBoundingClientRect()
1295 + .top
1296 + );
1233 1233  
1234 - saveOriginal(
1235 - row.content,
1236 - originalMarginTop,
1237 - "margin-top"
1238 - );
1298 + if(!seenHeaders.has(key)){
1299 + seenHeaders.add(key);
1300 + unique.push(row);
1301 + }
1302 + });
1239 1239  
1240 - var current=
1241 - num(
1242 - getComputedStyle(
1243 - row.content
1244 - ).marginTop
1245 - );
1304 + unique.forEach(function(row){
1305 + var headerRect=
1306 + row.el
1307 + .getBoundingClientRect();
1246 1246  
1247 - row.content.style.setProperty(
1248 - "margin-top",
1249 - (
1250 - current+
1251 - delta
1252 - )+"px"
1309 + row.el.style.setProperty(
1310 + "background",
1311 + row.theme.bg,
1312 + "important"
1253 1253   );
1254 1254  
1255 - row.content.setAttribute(
1256 - "data-sn-first-content-aligned",
1257 - "7"
1315 + row.el.style.setProperty(
1316 + "color",
1317 + row.theme.text,
1318 + "important"
1258 1258   );
1259 1259  
1260 - contentManaged.add(
1261 - row.content
1321 + row.el.style.setProperty(
1322 + "text-align",
1323 + "left",
1324 + "important"
1262 1262   );
1326 +
1327 + row.el.style.setProperty(
1328 + "word-spacing",
1329 + "normal",
1330 + "important"
1331 + );
1332 +
1333 + var later=
1334 + unique
1335 + .filter(function(other){
1336 + return (
1337 + other.card===row.card&&
1338 + other.el
1339 + .getBoundingClientRect()
1340 + .top>
1341 + headerRect.top+2
1342 + );
1343 + })
1344 + .sort(function(a,b){
1345 + return (
1346 + a.el
1347 + .getBoundingClientRect()
1348 + .top-
1349 + b.el
1350 + .getBoundingClientRect()
1351 + .top
1352 + );
1353 + });
1354 +
1355 + var stopTop=
1356 + later.length
1357 + ?later[0].el
1358 + .getBoundingClientRect()
1359 + .top
1360 + :Infinity;
1361 +
1362 + Array.from(
1363 + row.card.querySelectorAll("a")
1364 + ).forEach(function(link){
1365 + if(!visible(link))return;
1366 +
1367 + var rect=
1368 + link.getBoundingClientRect();
1369 +
1370 + if(
1371 + rect.top<=
1372 + headerRect.bottom-2||
1373 + rect.top>=
1374 + stopTop-2
1375 + ){
1376 + return;
1377 + }
1378 +
1379 + var candidates=
1380 + rowCandidates(
1381 + link,
1382 + row.card
1383 + );
1384 +
1385 + var target=
1386 + chooseOuterRow(
1387 + candidates,
1388 + link
1389 + );
1390 +
1391 + candidates.forEach(function(el){
1392 + el.style.setProperty(
1393 + "border-left",
1394 + "0 solid transparent",
1395 + "important"
1396 + );
1397 + });
1398 +
1399 + target.style.setProperty(
1400 + "border-left",
1401 + "3px solid "+
1402 + row.theme.accent,
1403 + "important"
1404 + );
1405 +
1406 + target.style.setProperty(
1407 + "box-sizing",
1408 + "border-box",
1409 + "important"
1410 + );
1411 + });
1263 1263   });
1264 1264  
1265 - return true;
1414 + return unique;
1266 1266   }
1267 1267  
1268 - function applyRow(group){
1269 - if(!validRow(group))return false;
1417 + /* =======================================================
1418 + OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW
1419 + ======================================================= */
1270 1270  
1421 + function alignOverviewCards(headers){
1422 + if(
1423 + PAGE_KIND!=="overview"||
1424 + window.innerWidth<=MOBILE_MAX
1425 + ){
1426 + return;
1427 + }
1428 +
1271 1271   var cards=[];
1272 1272   var seen=new Set();
1273 1273  
1274 - group.entries.forEach(function(entry){
1275 - if(!seen.has(entry.target)){
1276 - seen.add(entry.target);
1277 - cards.push(entry.target);
1432 + headers.forEach(function(row){
1433 + if(!seen.has(row.card)){
1434 + seen.add(row.card);
1435 + cards.push(row.card);
1278 1278   }
1279 1279   });
1280 1280  
1281 - if(cards.length<2)return false;
1282 -
1283 - if(
1284 - !alignKnownBars(cards)
1285 - ){
1286 - alignGeneric(cards);
1439 + if(cards.length<2){
1440 + return;
1287 1287   }
1288 1288  
1289 - var maxHeight=0;
1443 + // Group cards by actual top position.
1444 + var groups=[];
1290 1290  
1291 1291   cards.forEach(function(card){
1292 - maxHeight=
1293 - Math.max(
1294 - maxHeight,
1295 - card.getBoundingClientRect().height
1296 - );
1447 + var top=
1448 + card.getBoundingClientRect().top;
1449 +
1450 + var group=null;
1451 +
1452 + for(var i=0;i<groups.length;i++){
1453 + if(
1454 + Math.abs(
1455 + groups[i].top-top
1456 + )<=ROW_TOLERANCE
1457 + ){
1458 + group=groups[i];
1459 + break;
1460 + }
1461 + }
1462 +
1463 + if(!group){
1464 + group={
1465 + top:top,
1466 + cards:[]
1467 + };
1468 + groups.push(group);
1469 + }
1470 +
1471 + group.cards.push(card);
1297 1297   });
1298 1298  
1299 - maxHeight=
1300 - Math.ceil(
1301 - maxHeight
1302 - );
1474 + groups.forEach(function(group){
1475 + if(group.cards.length<2){
1476 + return;
1477 + }
1303 1303  
1304 - if(maxHeight<MIN_H)return false;
1479 + var firstHeaders=
1480 + group.cards.map(function(card){
1481 + var candidates=
1482 + headers
1483 + .filter(function(row){
1484 + return row.card===card;
1485 + })
1486 + .sort(function(a,b){
1487 + return (
1488 + a.el
1489 + .getBoundingClientRect()
1490 + .top-
1491 + b.el
1492 + .getBoundingClientRect()
1493 + .top
1494 + );
1495 + });
1305 1305  
1306 - cards.forEach(function(card){
1307 - saveOriginal(
1308 - card,
1309 - originalMinHeight,
1310 - "min-height"
1311 - );
1497 + return candidates.length
1498 + ?candidates[0]
1499 + :null;
1500 + });
1312 1312  
1313 - card.style.setProperty(
1314 - "min-height",
1315 - maxHeight+"px"
1316 - );
1502 + if(
1503 + !firstHeaders.some(function(row){
1504 + return !row;
1505 + })
1506 + ){
1507 + var targetTop=
1508 + Math.max.apply(
1509 + Math,
1510 + firstHeaders.map(function(row){
1511 + return (
1512 + row.el
1513 + .getBoundingClientRect()
1514 + .top-
1515 + row.card
1516 + .getBoundingClientRect()
1517 + .top
1518 + );
1519 + })
1520 + );
1317 1317  
1318 - card.setAttribute(
1319 - "data-sn-equal-height-managed",
1320 - "7"
1321 - );
1522 + firstHeaders.forEach(function(row){
1523 + var relativeTop=
1524 + row.el
1525 + .getBoundingClientRect()
1526 + .top-
1527 + row.card
1528 + .getBoundingClientRect()
1529 + .top;
1322 1322  
1323 - heightManaged.add(card);
1324 - });
1531 + var delta=
1532 + targetTop-relativeTop;
1325 1325  
1326 - return true;
1327 - }
1534 + if(delta>1){
1535 + saveStyle(
1536 + row.el,
1537 + originalMargin,
1538 + "margin-top"
1539 + );
1328 1328  
1329 - function calculate(force){
1330 - if(applying)return;
1541 + var current=
1542 + num(
1543 + getComputedStyle(
1544 + row.el
1545 + ).marginTop
1546 + );
1331 1331  
1332 - var width=
1333 - Math.round(
1334 - window.innerWidth
1335 - );
1548 + row.el.style.setProperty(
1549 + "margin-top",
1550 + (
1551 + current+delta
1552 + )+"px"
1553 + );
1336 1336  
1337 - var meaningful=
1338 - lastWidth<0||
1339 - Math.abs(
1340 - width-
1341 - lastWidth
1342 - )>=
1343 - MIN_WIDTH_CHANGE;
1555 + row.el.setAttribute(
1556 + "data-sn-master-first-row",
1557 + "1"
1558 + );
1344 1344  
1560 + managedMargin.add(
1561 + row.el
1562 + );
1563 + }
1564 + });
1565 + }
1566 +
1567 + var maxHeight=0;
1568 +
1569 + group.cards.forEach(function(card){
1570 + maxHeight=
1571 + Math.max(
1572 + maxHeight,
1573 + card
1574 + .getBoundingClientRect()
1575 + .height
1576 + );
1577 + });
1578 +
1579 + maxHeight=
1580 + Math.ceil(maxHeight);
1581 +
1582 + group.cards.forEach(function(card){
1583 + saveStyle(
1584 + card,
1585 + originalHeight,
1586 + "min-height"
1587 + );
1588 +
1589 + card.style.setProperty(
1590 + "min-height",
1591 + maxHeight+"px"
1592 + );
1593 +
1594 + card.setAttribute(
1595 + "data-sn-master-equal-height",
1596 + "1"
1597 + );
1598 +
1599 + managedHeight.add(
1600 + card
1601 + );
1602 + });
1603 + });
1604 + }
1605 +
1606 + /* =======================================================
1607 + DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY
1608 + ======================================================= */
1609 +
1610 + function equaliseDetailGrids(){
1345 1345   if(
1346 - hasApplied&&
1347 - !force&&
1348 - !meaningful
1612 + PAGE_KIND!=="detail"||
1613 + window.innerWidth<=MOBILE_MAX
1349 1349   ){
1350 1350   return;
1351 1351   }
1352 1352  
1353 - applying=true;
1618 + var selectors=[
1619 + ".arsn-grid",
1620 + ".arsn-grid-2",
1621 + ".arsn-grid-3",
1622 + ".dmp-grid",
1623 + ".ido-grid",
1624 + ".pp-grid"
1625 + ];
1354 1354  
1355 - try{
1356 - harmoniseCustomCallouts();
1627 + selectors.forEach(function(selector){
1628 + Array.from(
1629 + root.querySelectorAll(selector)
1630 + ).forEach(function(grid){
1631 + var children=
1632 + Array.from(
1633 + grid.children||[]
1634 + ).filter(visible);
1357 1357  
1358 - if(width<=MOBILE_MAX){
1359 - if(hasApplied){
1360 - resetRuntime();
1636 + if(children.length<2){
1637 + return;
1361 1361   }
1362 1362  
1363 - hasApplied=false;
1364 - lastWidth=width;
1365 - return;
1366 - }
1640 + var groups=[];
1367 1367  
1368 - if(hasApplied){
1369 - resetRuntime();
1370 - }
1642 + children.forEach(function(child){
1643 + var top=
1644 + child
1645 + .getBoundingClientRect()
1646 + .top;
1371 1371  
1372 - var parents=
1373 - Array.from(
1374 - root.querySelectorAll("*")
1375 - )
1376 - .filter(function(parent){
1377 - return (
1378 - visible(
1379 - parent,
1380 - MIN_W,
1381 - MIN_H
1382 - )&&
1383 - parent.children&&
1384 - parent.children.length>=2&&
1385 - parent.children.length<=
1386 - MAX_PARENT_CHILDREN
1387 - );
1388 - });
1648 + var group=null;
1389 1389  
1390 - var touched=
1391 - new Set();
1650 + for(var i=0;i<groups.length;i++){
1651 + if(
1652 + Math.abs(
1653 + groups[i].top-top
1654 + )<=ROW_TOLERANCE
1655 + ){
1656 + group=groups[i];
1657 + break;
1658 + }
1659 + }
1392 1392  
1393 - parents.forEach(function(parent){
1394 - var entries=[];
1661 + if(!group){
1662 + group={
1663 + top:top,
1664 + items:[]
1665 + };
1666 + groups.push(group);
1667 + }
1395 1395  
1396 - Array.from(
1397 - parent.children
1398 - ).forEach(function(child){
1399 - if(
1400 - !visible(
1401 - child,
1402 - MIN_W,
1403 - MIN_H
1404 - )
1405 - ){
1669 + group.items.push(child);
1670 + });
1671 +
1672 + groups.forEach(function(group){
1673 + if(group.items.length<2){
1406 1406   return;
1407 1407   }
1408 1408  
1409 - var target=
1410 - pickTarget(child);
1677 + var maxHeight=0;
1411 1411  
1412 - if(!target)return;
1413 -
1414 - entries.push({
1415 - target:target,
1416 - rect:
1417 - target.getBoundingClientRect()
1679 + group.items.forEach(function(item){
1680 + maxHeight=
1681 + Math.max(
1682 + maxHeight,
1683 + item
1684 + .getBoundingClientRect()
1685 + .height
1686 + );
1418 1418   });
1419 - });
1420 1420  
1421 - groupRows(
1422 - entries
1423 - ).forEach(function(group){
1424 - if(!validRow(group))return;
1689 + maxHeight=
1690 + Math.ceil(maxHeight);
1425 1425  
1426 - var targets=
1427 - group.entries.map(function(entry){
1428 - return entry.target;
1429 - });
1692 + group.items.forEach(function(item){
1693 + saveStyle(
1694 + item,
1695 + originalHeight,
1696 + "min-height"
1697 + );
1430 1430  
1431 - if(
1432 - !targets.some(function(el){
1433 - return !touched.has(el);
1434 - })
1435 - ){
1436 - return;
1437 - }
1699 + item.style.setProperty(
1700 + "min-height",
1701 + maxHeight+"px"
1702 + );
1438 1438  
1439 - if(applyRow(group)){
1440 - targets.forEach(function(el){
1441 - touched.add(el);
1442 - });
1443 - }
1704 + item.setAttribute(
1705 + "data-sn-master-equal-height",
1706 + "1"
1707 + );
1708 +
1709 + managedHeight.add(item);
1710 + });
1444 1444   });
1445 1445   });
1713 + });
1714 + }
1446 1446  
1447 - lastWidth=width;
1448 - hasApplied=true;
1716 + /* =======================================================
1717 + RUN / RESPONSIVE SCHEDULING
1718 + ======================================================= */
1719 +
1720 + function run(){
1721 + if(running)return;
1722 +
1723 + running=true;
1724 +
1725 + try{
1726 + resetRuntime();
1727 + applyPlaceholderBadge();
1728 + propagateDetailAccents();
1729 +
1730 + var headers=
1731 + applyOverviewPalette();
1732 +
1733 + makeThreeLineAreaLabels();
1734 + makeFilledRedOrangeCTAsBorderless();
1735 +
1736 + if(
1737 + window.innerWidth>
1738 + MOBILE_MAX
1739 + ){
1740 + alignOverviewCards(
1741 + headers
1742 + );
1743 +
1744 + equaliseDetailGrids();
1745 + }
1449 1449   }finally{
1450 - applying=false;
1747 + running=false;
1451 1451   }
1452 1452   }
1453 1453  
1454 - function resize(){
1751 + function onResize(){
1455 1455   if(resizeTimer){
1456 1456   clearTimeout(
1457 1457   resizeTimer
... ... @@ -1462,19 +1462,40 @@
1462 1462   setTimeout(
1463 1463   function(){
1464 1464   resizeTimer=0;
1465 - calculate(false);
1762 + run();
1466 1466   },
1467 1467   RESIZE_DEBOUNCE
1468 1468   );
1469 1469   }
1470 1470  
1471 - function waitImages(){
1768 + async function waitForReady(){
1769 + if(
1770 + document.readyState!=="complete"
1771 + ){
1772 + await new Promise(function(resolve){
1773 + window.addEventListener(
1774 + "load",
1775 + resolve,
1776 + {once:true}
1777 + );
1778 + });
1779 + }
1780 +
1781 + if(
1782 + document.fonts&&
1783 + document.fonts.ready
1784 + ){
1785 + try{
1786 + await document.fonts.ready;
1787 + }catch(error){}
1788 + }
1789 +
1472 1472   var images=
1473 1473   Array.from(
1474 1474   root.querySelectorAll("img")
1475 1475   );
1476 1476  
1477 - return Promise.all(
1795 + await Promise.all(
1478 1478   images.map(function(img){
1479 1479   if(img.complete){
1480 1480   return Promise.resolve();
... ... @@ -1499,46 +1499,20 @@
1499 1499   });
1500 1500   })
1501 1501   );
1502 - }
1503 1503  
1504 - async function initial(){
1505 - if(
1506 - document.readyState!==
1507 - "complete"
1508 - ){
1509 - await new Promise(function(resolve){
1510 - addEventListener(
1511 - "load",
1512 - resolve,
1513 - {once:true}
1514 - );
1515 - });
1516 - }
1517 -
1518 - if(
1519 - document.fonts&&
1520 - document.fonts.ready
1521 - ){
1522 - try{
1523 - await document.fonts.ready;
1524 - }catch(error){}
1525 - }
1526 -
1527 - await waitImages();
1528 -
1529 - // Exactly one initial layout calculation.
1530 - calculate(true);
1821 + run();
1531 1531   }
1532 1532  
1533 - addEventListener(
1824 + window.addEventListener(
1534 1534   "resize",
1535 - resize,
1826 + onResize,
1536 1536   {passive:true}
1537 1537   );
1538 1538  
1539 - initial();
1830 + waitForReady();
1540 1540  })();
1541 1541  </script>
1542 1542  
1543 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END -->
1544 -{{/html}}\n
1834 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END -->
1835 +{{/html}}
1836 +