@namespace bf "http://id.loc.gov/ontologies/bibframe/";
@namespace dc "http://purl.org/dc/elements/1.1/";
@namespace exml "https://sub.uni-goettingen.de/met/standards/entity-xml#";
@namespace gndo "https://d-nb.info/standards/elementset/gnd#";
@namespace mml "http://www.w3.org/1998/Math/MathML";
@namespace oxy "http://www.oxygenxml.com/extensions/author";
@namespace svg "http://www.w3.org/2000/svg";
@namespace tei "http://www.tei-c.org/ns/1.0";
@namespace xi "http://www.w3.org/2001/XInclude";
@namespace xlink "http://www.w3.org/1999/xlink";
@namespace xml "http://www.w3.org/XML/1998/namespace";


/* ####################################################### */
/* ################# General Components ################## */

/* ~ Comments */
oxy|comment {
    display:none !important;
}

/* oxy|comment::before {
    display:none !important;
} */

/* text {
    display: block;
    margin-left: 40px;
    margin-right: 40px;
}*/



/* ######################################################### */
/* ################# Strutural Components ################## */

eupt{
    /* font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; */
    padding: 20px !important;
}

header {
    padding: 15px;
    border-bottom: 1px solid lightgray ;
    margin-bottom: 20px;
    background: rgba(173, 216, 230, 0.568);
}

header title {
    display: block;
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 10px;
}



header sourceDesc {
    display: block;
    margin-bottom: 20px;
}

header revisionDesc::before {
    content: "Revisionsbeschreibung";
    padding: 2px 5px;
    background: brown;
    color: white;
    font-weight: 600;
}

header revisionDesc {
    display: block;
    border-top: 1px dashed brown;
    border-bottom: 1px dashed brown;
    padding: 10px 0;
    margin-bottom: 20px;
}

header revisionDesc > change::before {
    content: oxy_xpath("@when||': '");
    /* color: gray; */
    font-style: italic;
}

header revisionDesc > change {
    display: block;
}

text > *,
container > *,
div[type=poetological] > div {
    /* display: block; */
    margin-bottom: 2em;
}

text > *::before,
container > *::before {
    display: block;
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

text > *[type]::before,
container > *[type]::before {
    content: oxy_xpath( "concat(upper-case(substring(./@type,1,1)),substring(./@type, 2),' '[not(last())])" );
    border-bottom: 2px solid brown;
}

text > *::before,
container > *::before {
    content: oxy_xpath( "concat(upper-case(substring(./name(),1,1)),substring(./name(), 2),' '[not(last())])" );
    border-bottom: 2px solid brown;
}


div[type=kola]::before,
div[type=verses]::before,
div[type=poetological] > div::before {
    border-bottom: 2px solid blue;
}

facsimile,
div[type=poetological] > div,
div[type=vocalisation],
div[type=translation]{
    padding: 0 10px 10px 10px;
}



div[type=vocalisation],
div[type=translation]{
    border-left: 3px solid orange;
    border-bottom: 3px solid orange;
    background-color: rgba(255, 248, 240, 0.774);
}

div[type=kola],
div[type=verses],
div[type=poetological] > div {
    border-left: 3px solid blue;
    border-bottom: 3px solid blue;
    background-color: rgba(240, 241, 255, 0.774);
}

/* div[type=kola] > div,
div[type=verses] > ab,
div[type=vocalisation] > ab,
div[type=translation] > ab {
    display: block;
} */


/* #################{ Metadata BLOCK }##################*/

header > textClass,
header > sourceDesc,
header > revisionDesc {
    display: block;
    margin-bottom: 1.5em;
}


/* ~~~ Überschriften, Ebene 1 ~~~ */

header sourceDesc > abstract:before(500),
header > sourceDesc > msDesc > msIdentifier:before(500),
header > sourceDesc > msDesc > physDesc:before(500),
header > sourceDesc > msDesc > history:before(500),
header > sourceDesc > msDesc > additional > surrogates:before(500),
header > sourceDesc > msDesc > additional > listBibl:before(500) {
    content: oxy_xpath('name()');
}

header sourceDesc > abstract:before(500),
header > sourceDesc > msDesc > msIdentifier:before(500), 
header > sourceDesc > msDesc > physDesc:before(500),
header > sourceDesc > msDesc > history:before(500),
header > sourceDesc > msDesc > additional > surrogates:before(500),
header > sourceDesc > msDesc > additional > listBibl:before(500) {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    border-bottom: 1px solid brown;
    margin-bottom: 10px;
}

header sourceDesc > abstract:before(500) {
    content: "Abstract";
}

header > sourceDesc > msDesc > msIdentifier:before(500) {
    content: "Identifikatoren & Katalogisierungsnummern";
}

header > sourceDesc > msDesc > physDesc:before(500) {
    content: "Physische Beschreibung";
}

header > sourceDesc > msDesc > history:before(500) {
    content: "Provenienzinformationen";
}

header > sourceDesc > msDesc > additional > surrogates:before(500) {
    content: "Fotosammlungen (online)";
}

header > sourceDesc > msDesc > additional > listBibl:before(500) {
    content: "Bibliographie"
}

header > sourceDesc > msDesc > additional > listBibl[type=fotos]:before(500) {
    content: "Fotos"
}

header > sourceDesc > msDesc > additional > listBibl[type=copies]:before(500) {
    content: "Kopien (Autographien)"
}

header > sourceDesc > msDesc > additional > listBibl[type=transliterations]:before(500) {
    content: "Transliterationen"
}

header > sourceDesc > msDesc > additional > listBibl[type=translations]:before(500) {
    content: "Übersetzungen"
}

header > sourceDesc > msDesc > additional > listBibl[type=studies]:before(500) {
    content: "Studien und Untersuchungen"
}

/* ~~~ Überschriften, Ebene 2 ~~~ */

header > sourceDesc > msDesc > history > origin::before(500),
header > sourceDesc > msDesc > history > provenance::before(500) {
    display: block;
    font-size: 1em;
    font-weight: 600;

}

header > sourceDesc > msDesc > history > origin::before(500) {
    content: "Ursprungsinformation";
}

header > sourceDesc > msDesc > history > provenance::before(500) {
    content: "Weitere Provenienzinformation";
}

/* ~~~ Metadaten Sektionen ~~~ */

header p {
    line-height: 1.5em;
    display: block;
    margin-bottom: 5px;
}

header > sourceDesc > abstract,
header > sourceDesc > msDesc,
header > sourceDesc > msDesc > * {
    display: block;
    margin-bottom: 1em;
}

/* header sourceDesc > msDesc:before,
header sourceDesc > abstract:before {
    display: block;
    font-size: 1em;
    font-weight: 600;
} */

/* header sourceDesc > abstract:before(500),
header > sourceDesc > msDesc > msIdentifier:before(500),
header > sourceDesc > msDesc > physDesc:before(500),
header > sourceDesc > msDesc > history:before(500),
header > sourceDesc > msDesc > additional > surrogates:before(500),
header > sourceDesc > msDesc > additional > listBibl:before(500) {
    display: block;
    font-size: 1em;
    font-weight: 600;
} */



header > sourceDesc > msDesc > msIdentifier > settlement,
header > sourceDesc > msDesc > msIdentifier > repository {
    border: 1px solid brown;
    -oxy-display-tags: none;
    margin-right: 5px;
    padding-right: 3px;
}

header > sourceDesc > msDesc > msIdentifier > settlement:before(100),
header > sourceDesc > msDesc > msIdentifier > repository:before(100) {
    background: brown;
    color: white;
    content: oxy_xpath('name()');
    padding: 0 3px;
}

header > sourceDesc > msDesc > msIdentifier > settlement:before(10),
header > sourceDesc > msDesc > msIdentifier > repository:before(10) {
    content: " ";
}

header > sourceDesc > msDesc > msIdentifier > idno {
    display: block;
    padding-left: 5px;
    margin-bottom: 3px;
    border-left: 3px solid brown;

}

header > sourceDesc > msDesc > msIdentifier > idno:after {
    content: 
        " ("
        oxy_xpath('@type')
        ")";
}

header > sourceDesc > msDesc > msIdentifier > idno:focus:after {
    content: 
        " ("
        oxy_popup(
            edit, '@type', 
            values, "Museumsnummer, Grabungsnummer, Publikationsnummer",
            labels, "Museumsnummer, Grabungsnummer, Publikationsnummer",
            fontInherit, true, 
            selectionMode, single
        )
        ")";
}

header > sourceDesc > msDesc > physDesc > objectDesc,
header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc {
    display: block;
}

header > sourceDesc > msDesc > physDesc > objectDesc:before(200) {
    content: 
        "Form: ";
}

header > sourceDesc > msDesc > physDesc > objectDesc:before(199) {
    content: 
        oxy_xpath('@form');
}

header > sourceDesc > msDesc > physDesc > objectDesc:focus:before(199) {
    content:
        oxy_popup(
            edit, '@form', 
            values, "Tafel",
            labels, "Tafel",
            fontInherit, true, 
            selectionMode, single
        );
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > support {
    -oxy-display-tags: none;
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > support:before(200) {
    content: 
        "Material: ";
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > extent {
    display: block;
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > extent:before(200) {
    content: 
        "Umfang: ";
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > extent width,
header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > extent height {
    -oxy-display-tags: none;
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > extent > dimensions {
    -oxy-display-tags: none;
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > extent > dimensions > *:not(:last-child) {
    margin-right: 5px;
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > extent height:after(200) {
    -oxy-display-tags: none;
    content: " (Höhe)";
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > extent width:after(200) {
    -oxy-display-tags: none;
    content: " (Breite)";
}

header > sourceDesc > msDesc > physDesc > objectDesc > supportDesc > extent height:after(200) {
    -oxy-display-tags: none;
    content: " (Höhe)";
}

header > sourceDesc > msDesc > history:before(100) {
    content: 
        oxy_button(
            action, oxy_action(
                name, "Ursprungsinformation angeben",
                operation, 'InsertFragmentOperation',
                arg-fragment, '<origin xmlns="http://sub.uni-goettingen.de/edxml#"><p>${caret}</p></origin>',
                arg-insertLocation, './element()[1]',
                arg-insertPosition, 'Before'
            ));;
}

header > sourceDesc > msDesc > history:before(90) {
    content: 
        oxy_button(
            action, oxy_action(
                name, "Provenienzinformation angeben",
                operation, 'InsertFragmentOperation',
                arg-fragment, '<provenance xmlns="http://sub.uni-goettingen.de/edxml#"><p>${caret}</p></provenance>',
                arg-insertLocation, './element()[last()]',
                arg-insertPosition, 'After'
            ));;
}

header > sourceDesc > msDesc > history > origin,
header > sourceDesc > msDesc > history > provenance {
    display: block;
    margin-bottom: 5px;
}




header > sourceDesc > msDesc > additional > surrogates,
header > sourceDesc > msDesc > additional > listBibl {
    margin-bottom: 15px;
}

header > sourceDesc > msDesc > additional > surrogates > *,
header > sourceDesc > msDesc > additional > listBibl > * {
    display: block;
}

header > sourceDesc > msDesc > additional > surrogates > head {
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: bold;
}

header > sourceDesc > msDesc > additional > surrogates:before(100) {
    content: 
        oxy_button(
            action, oxy_action(
                name, "Link hinzufügen",
                operation, 'InsertFragmentOperation',
                arg-fragment, '<graphic xmlns="http://sub.uni-goettingen.de/edxml#" url="">${caret}</graphic>',
                arg-insertLocation, '.',
                arg-insertPosition, 'Inside as last child'
            ));;
}

header > sourceDesc > msDesc > additional > surrogates > graphic[url] {
    -oxy-link:attr(url);
    color: blue;
    text-decoration: underline;
}

header > sourceDesc > msDesc > additional > listBibl:before(100) {
    content: 
        oxy_button(
            action, oxy_action(
                name, "Eintrag hinzufügen",
                operation, 'InsertFragmentOperation',
                arg-fragment, '<bibl xmlns="http://sub.uni-goettingen.de/edxml#">${caret}</bibl>',
                arg-insertLocation, '.',
                arg-insertPosition, 'Inside as last child'
            ));;
}

header > sourceDesc > msDesc > additional > listBibl > bibl[zotero] {
    -oxy-link: 
        oxy_xpath("for $ref in @zotero return (root()//*:zotero[@prefix = tokenize($ref, ':')[1]]/@xml:base||tokenize($ref, ':')[last()])");
    color: blue;
    text-decoration: underline;
}

/* #################{ Einleitung }##################*/
front > div,
front > div > head,
front > div > p {
    display: block;
}

front > div {
    padding: 0 15px;
}

front head {
    font-size: 2em;
    font-weight: 600;
    border-bottom: 2px solid brown;
    margin-bottom: 1em; 
}

front p {
    line-height: 1.5em;
    margin-bottom: 1.5em;
}

p bibl {
    font-style: italic;
}

p bibl:after(100) {
    content: " (Biblio. Angabe)";
    font-style: normal;
}

/* #################{ Faksimile BLOCK }##################*/
facsimile {
    /* border-left: 3px solid brown; */
    padding: 20px;
    /* border-bottom: 3px solid brown; */
    /* background-color: rgba(255, 240, 240, 0.774); */
}

facsimile::before{
    border-bottom: 2px solid brown;
    content:"Transliteration";
    margin-bottom: 1em;
}

facsimile > surface line::before(2) {
    margin-right: 15px;
    padding-right: 10px;
    border-right: 1px solid brown;
    font-family: monospace;
    width: 3em;
}

facsimile > surface line::before(2) {
    content:    
        oxy_textfield(
            edit, '@n', 
            color, "black",
            fontInherit, true, 
            columns, 5, 
            hoverPseudoclassName, 'hi'
        );
}

facsimile > surface line {
    display: block;
    line-height: 2em;
}

facsimile > surface line * {
    line-height: 2em;
}

facsimile > surface metamark,
facsimile > surface part,
facsimile > surface seg,
facsimile > surface g {
    -oxy-display-tags: none;
}

facsimile > surface part {
    background:rgba(194, 194, 194, 0.432);
}

facsimile > surface seg {
    background:rgba(224, 181, 181, 0.432);
}

facsimile > surface g {
    border-color: rgba(223, 165, 165, 0.842);
    border-left:1px solid;
}

facsimile > surface g:last-of-type {
    border-right:1px solid;
}

facsimile > surface metamark[rend=line] {
    display:block;
    border-bottom: 2px solid gray;
    content: "";
}


/* #####################{  UNITS  }####################*/
structure units > * {
    padding-left: 20px;
}

units > * {
    display: block;
}

units > unit:not(:last-of-type) {
    margin-bottom: 3em;
}

units > unit {
    border-left: 3px solid brown;
    border-right: 3px solid brown;
    padding: 0em 1em;
}

units > unit::before(10),
units > unit::before(9),
units > unit::before(8),
units > unit::before(7),
units > unit::before(6),
units > unit::before(5) {
    margin-right: 10px;
    font-size: 1.2em;
    font-weight: 600;
    color: black;
}

/*-- BEFORE 10: Unit Name --*/
units > unit:not([type])::before(10) {
    content: oxy_xpath(" ./name() ");
}

units > unit[type]::before(10) {
    content: oxy_xpath(" @type ");
}

/*-- BEFORE 9: Numbering --*/
units > unit:not([n])::before(9) {
    content: oxy_xpath(" count( preceding-sibling::element() )+1 ");
}

units > unit[n]::before(9) {
    content: oxy_xpath("@n");
}

/*-- BEFORE 8-5: <Empty/> --*/
/*-- BEFORE 4: Unit-ID --*/
units > unit[xml|id]::before(4) {
    margin-left: 1em;
    font-size: 1em;
    color: gray;
}

units > unit[xml|id]::before(4) {
    content: oxy_xpath(" '#'||@xml:id||'' ");
}

units > unit[xml|id]:focus::before(4) {
    content: 
        "#" 
        oxy_textfield(
            edit, '@xml:id', 
            columns, 10, 
            fontInherit, 'true'
        );
}

units > unit:not([xml|id])::before(4) {
    content: oxy_button(
        actionID, 'insert.id' 
    );
}

/*-- BEFORE 3: ... --*/
units > unit[corresp]::before(3) {
    line-height: 2em;
    width: 7em;
    font-style: italic;
    font-family: monospace;
}

units > unit[corresp]::before(3) {
    content: "\A @corresp.: ";
}

units > unit[corresp]::before(2) {
    line-height: 2em;
    width: 7em;
    font-family: monospace;
}

units > unit[corresp]::before(2) {
    content: oxy_xpath( " string-join( (for $id in tokenize(@corresp, ' ') return //*[@xml:id = substring-after($id, '#')]), ' ' ) ");
}

units > unit[corresp]:hover::before(1) {
    content: 
        "[\2197 " 
        oxy_xpath(" string-join( ( for $id in tokenize(./@corresp, ' ') return $id ), ' + ' ) ") 
        "] ";
    color:gray;
    margin-left: 20px;

}


/* #####################{  UNIT  }####################*/
unit > * {
    display: block;
    line-height: 2.5em;
}

unit > *::before(10) {
    width: 7em;
    font-style: italic;
    font-family: monospace;
}

unit > layer::before(10) {
    content: oxy_xpath( "./@type || ':'" );
}


/* ################# Philology BLOCK ###############*/
philology {
    padding: 20px;
}

philology::before {
    margin-bottom: 1em;
}

philology > units > unit[corresp]::before(3) {
    content: "\A translit.:";
}

philology > units > unit {
    display: block;
    margin-bottom: 30px;
}

philology > units transcription::before(10) {
    content: "transc.:";
}

philology > units transcription[type]::before(10) {
    content: oxy_xpath(" substring(@type, 1, 6) || '.:' ");
}

/* unit > transcription[copy=true]::after {
    content: " [\2197 " oxy_xpath( " string-join( ( for $id in tokenize(parent::unit/@corresp, ' ') return $id ), ' + ' ) ") "] "; 
    margin-left: 20px;
    color:gray
}   

unit > transcription[copy=true] {
    content: oxy_xpath( " string-join( (for $id in tokenize(parent::unit/@corresp, ' ') return //*[@xml:id = substring-after($id, '#')]), ' ' ) "); 
} */

/* vocalisation */
/* unit > vocalisation::before {
    content: "vocali.:";
} */

/* translation */
unit > translation::before(10) {
    content: "transl.:";
    width: 2em;
}

unit > translation::before(2) {
    content: oxy_xpath("' @'||@xml:lang");
    font-family: monospace;
    font-size: 1em;
    color:gray;
    width: 5em;
}


unit > motive::before(10) {
    content: "motive:";
}

philology unit:hover *[ana]::before(2) {
    content: oxy_xpath("'['||@ana||']'");
    color: rgb(95, 95, 95);
    font-family: monospace;
    font-size: 0.8em;
    margin-right: 5px;
}

philology unit:hover *[ana][lemma]::before(2) {
    content: oxy_xpath("'[' || @ana || ' < ' || @lemma || ']'");
}

philology phr:not(ana),
philology w:not(ana) {
    background-color: rgba(218, 218, 218, 0.432);
    -oxy-display-tags: none;
}

philology *[ana] {
    background-color: rgba(235, 183, 183, 0.432);
    position: absolute;
    -oxy-display-tags: none;
}



/* ################# Relations BLOCK ###############*/

relations {
    padding: 20px;
}

relations:has( head )::before{
    display: none;
}

relations > head {
    display: block;
    border-bottom: 2px solid brown;
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

relation {
    display: block;
    border-bottom: 1px dotted brown;
    padding: 10px 0;
}


relation::before(5) {
    content: oxy_xpath("'> '||@type||' >'");
    font-style: italic;
    margin-right: 10px;
}

relation::before(5):focus {
    content:    oxy_label(text, "relation-type: ")
                oxy_textfield(
                    edit, '@type', 
                    color, "black",
                    columns, 20
                );
    margin-right: 10px;
}

relation::before(6) {
    content: oxy_xpath(" for $id in ./@source return //*[@xml:id = substring-after($id, '#')]/text()");
    margin-right: 10px;
}

relation::before(6):focus {
    content:    oxy_label(text, "source: ")
                oxy_textfield(
                    edit, '@source', 
                    color, "black",
                    columns, 20
                );
    margin-right: 10px;
}

relation::before(4) {
    content: oxy_xpath(" for $id in ./@target return //*[@xml:id = substring-after($id, '#')]/text()");
    margin-right: 10px;
}

relation::before(4):focus {
    content:    oxy_label(text, "target: ")
                oxy_textfield(
                    edit, '@target', 
                    color, "black",
                    columns, 20
                );
    margin-right: 10px;
}

relation::before(1) {
    content: "\A\A";
}

/* ################# Poetology BLOCK ###############*/

structure[type=poetological] units > *::before(10),
structure[type=poetological] choice > *:not(group)::before(10),
structure[type=poetological] group > *::before(10) {
    content: oxy_xpath( "name()|| ' ' || count(preceding-sibling::element())+1" );
    font-weight: 600;
}

structure[type=poetological] units > *[n]::before(10),
structure[type=poetological] choice > *[n]:not(group)::before(10),
structure[type=poetological] group > *[n]::before(10) {
    content: oxy_xpath( "name()|| ' ' || @n" );
    font-weight: 600;
}

structure[type=poetological] kolon[units]::before(1) {
    /* content: oxy_xpath( "' \"'||string-join( (for $id in tokenize(./@corresp, ' ') return //*[@xml:id = substring-after($id, '#')]), ' ' )|| '\" '"); */
    content: oxy_xpath( "' \"'||string-join( (for $id in tokenize(./@units, ' ') return ( for $line-id in tokenize(//*[@xml:id = substring-after($id, '#')]/@corresp, ' ') return //*[@xml:id = substring-after($line-id, '#')] ) ), ' ' )|| '\" '");
    color: gray;
}

ana {
    display: block;
    color: black;
}

stanza,
verse,
kolon {
    margin-bottom: 10px;
}

stanza > *:not(units)::before,
verse > *:not(units)::before,
kolon > *:not(units)::before  {
    content: oxy_xpath(" name() || ': '");
    font-family: monospace;
    font-style: italic;
}

stanza > *:not(units),
verse > *:not(units),
kolon > *:not(units)  {
    display: block;
}

stanza {
    border-left: 3px solid brown;
    border-bottom: 3px solid brown;
    background:rgba(255, 240, 240, 0.774)
}

verse {
    border-left: 3px solid green;
    border-bottom: 3px solid green;
    background: rgba(207, 236, 207, 0.589);
}


kolon {
    border-left: 3px solid orange;
    border-bottom: 3px solid orange;
    background: rgba(255, 236, 201, 0.473);
}

structure[type=poetological] choice::before(2) {
    content: "Alternativen";
}

structure[type=poetological] choice > *::before(3) {
    content: oxy_xpath("'Option '||count(preceding-sibling::element())+1 ||': '");
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1em;
}

structure[type=poetological] choice {
    background:rgba(235, 201, 255, 0.473);
    padding: 10px 10px;
}



/* #################{ Notes }###############*/

notes::before(100) {
    content: "Notes";
    padding: 2px 5px;
    background: brown;
    color: white;
    font-weight: 600;
}

facsimile notes::before(100) {
    content: "Transliteration Notes";
}

philology > notes::before(100) {
    content: "Philological Notes";
}

unit notes::before(100) {
    display: none !important;
}

structure[type] notes::before(100) {
    content: oxy_xpath(" data(parent::structure/@type) ") " Notes";
}

back notes::before(100) {
    content: "General Notes";
}

notes {
    display:block;
    margin-top: 20px;
    border-top: 1px dashed brown;
    border-bottom: 1px dashed brown;
    padding: 10px;
}

unit > notes {
    margin-top: 0px;
    border-top: 1px dashed brown;
    border-bottom: 1px dashed brown;
    background: rgb(241, 232, 232);
}


/*********{ NOTE }**********/
notes > note,
div[type=epigraphic_notes] > note,
div[type=notes] > note {
    display: block;
    padding: 5px 0 !important;
    margin: 0 !important;
    line-height: 1em;
}

notes > note::before(100),
div[type=epigraphic_notes] > note::before(100),
div[type=notes] > note::before(100) {
    content: oxy_xpath( "count(preceding::note)+1 ||') '" );
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: 600;
}

notes > note[type]::before(90) {
    content: oxy_concat(oxy_replace(oxy_replace(oxy_xpath('@type'), 'con', 'inh'), ' ', '. / '), '.: ');
}

/* notes > note[target]::before(10) {
    content: oxy_xpath( " '[\2197] '" );
    color: gray;
} */

notes > note[target]:focus::before(10) {
    content: oxy_xpath( " '[\2197 '||data(./@target) ||'] '" );
    color: gray;
}

/* div[type=vocalisation] > * > span[xml|id]::after,
div[type=translation] > * > span[xml|id]::after {
    content: oxy_xpath( "for $id in (data(./@xml:id)) return if ( //note[@target = '#'||$id] ) then ( ''||count(//note[@target = '#'||$id]/preceding::note)+1||')' ) else ()" );
    color:brown;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-style: italic;
    vertical-align: sub;
    font-weight: 600;
    font-size: 0.8em;
} */

/* #################{ Note References aka. Footnote Markers }###############*/
*[xml|id]::after(2) {
    /* content: oxy_xpath(" (if( ./@xml:id = (//note/substring-after(@target, '#')) ) then ( ''|| (for $id in ./@xml:id return count(//note[@target = '#'||$id]/preceding::note)+1||')') ) else ()) ");
    content: oxy_xpath(" (if( '#'||./@xml:id = (//note/tokenize( @target, ' ' ) ) ) then ( ''|| (for $id in ./@xml:id return string-join(for $note in //note[contains(@target, '#'||$id)] return count($note/preceding::note)+1||')', ', ') ||'') ) else ()) "); */
    /* -oxy-append-content: oxy_label(text, oxy_xpath(" (if( '#'||./@xml:id = (//note/tokenize( @target, ' ' ) ) ) then ( ''|| (for $id in ./@xml:id return string-join(for $note in //note[ '#'||$id = tokenize(@target, ' ')] return '('||count($note/preceding::note)+1||')', ', ') ||'') ) else ()) "), styles, "font-weight:600; font-size: 0.7em; color:brown; font-style:normal; font-family:monospace;")  !important; */
    content: oxy_xpath(" (if( '#'||./@xml:id = (//note/tokenize( @target, ' ' ) ) ) then ( ''|| (for $id in ./@xml:id return string-join(for $note in //note[ '#'||$id = tokenize(@target, ' ')] return ''||count($note/preceding::note)+1||')', '') ||'') ) else ()) ")  !important;
    color:brown;
    font-family: monospace;
    font-style: normal;
    vertical-align: sub;
    font-weight: 600;
    font-size: 0.7em;
}

philology unit[xml|id]::after(2) {
    content:
        oxy_xpath(" (if( '#'||./@xml:id = (//note/tokenize( @target, ' ' ) ) ) then ( 'Anmerkungen: '|| (for $id in ./@xml:id return string-join(for $note in //note[ '#'||$id = tokenize(@target, ' ')] return ''||count($note/preceding::note)+1||')', '') ||'') ) else ('')) ")  !important;
    display: block;
    margin-top: 1em;
    /* border-top: 1px solid brown; */
}




/* #################{ Highlightings and transcriptional elements }############### */

hi,
hi[rend=italic]{
    font-style: italic;
    -oxy-display-tags: none;
}

sic,
corr,
choice,
reg,
orig,
add,
del,
unclear,
damage,
restore,
supplied,
surplus,
secl,
mod,
redo,
retrace,
undo {
    -oxy-display-tags: none;
}


sic::before, sic::after,
corr::before, corr::after,
reg::before, reg::after,
orig::before, orig::after,
add::before, add::after,
del::before, del::after,
unclear::before, unclear::after,
damage::before, damage::after,
restore::before restore::after,
supplied::before, supplied::after,
surplus::before, surplus::after,
secl::before, secl::after,
mod::before, mod::after,
redo::before, redo::after,
retrace::before, retrace::after,
undo::before, undo::after {
    color: brown;
}

add::before { content: "("; }
add::after { content: ")"; }

/* corr::before { content: "<"; }
corr::after { content: ">"; } */

sic::before { content: "!(Text:"; }
sic::after { content: ")"; }

/* choice > sic:not(:last-child) {
    display: none;
} */

damage::before { content: "["; }
damage::after { content: "]"; }

damage[degree=low]::before {
    content: "⸢";
}

damage[degree=low]::after {
    content: "⸣";
}

damage[degree=medium]::before {
    content: "⌈";
}

damage[degree=medium]::after {
    content: "⌉";
}

del::before { content: "[["; }
del::after { content: "]]"; }

supplied::before { content: "<"; }
supplied::after { content: ">"; }

surplus::before { content: "{"; }
surplus::after { content: "}"; }

/* Line Breaks */
lb::before,
lb::after {
    content: "|";
    color:gray;
}

lb {
    content: oxy_xpath( "@n");
    font-weight: 400;
    color:gray;
    -oxy-display-tags: none;
}

lb:focus {
    content: oxy_textfield(edit, "@n", columns, 5);
}

g[cert="uncertain"]::after(500) {
    content: "?";
}

/** LINKS **/
ref[target] {
    -oxy-link:attr(target);
    color: blue;
    text-decoration: underline;
}