Changes for page Prepare

Last modified by Veronika Kocher on Friday, 18 Sep 2026 16:47

From version 31.1
edited by Veronika Kocher
on Friday, 04 Sep 2026 15:32
Change comment: There is no comment for this version
To version 29.9
edited by Veronika Kocher
on Thursday, 03 Sep 2026 10:09
Change comment: There is no comment for this version

Summary

Details

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