@media print {
	.messagedivider { page-break-after: always; }
}

@media screen {
	.messagedivider { height: 0px; margin: 10px 0px; padding: 0px; border-bottom: 1px solid lightgray; }
}

/* Line wrapping */
div.plaintext { white-space: pre-wrap; }
div.markdown { white-space: normal; }

body {
	margin: 0;
	padding: 0;
}

/* Do not change the margin */
#main { padding: 8.0; }

/* Discrete links in quoted text */
blockquote a:link { color: #136BCE; }
/*blockquote a:active { color: red; }*/
blockquote blockquote a:link { color: #4B89CF; }
blockquote blockquote a:active { color: red; }

/* Show Raw Source */
pre.raw {
	white-space: pre-wrap;
	overflow-x: auto;
	margin-left: 5px;
	margin-right: 5px;
	background-color: #E4E4E4;
	padding: 5px;
	border: thin solid gray;
	border-radius: 0;
	max-width: none;
}

/* Attached messages are indented and given a frame and background color */
div.bodypart[type=message][subtype=rfc822] {
	margin-left: 20px;
	padding: 5px;
	background-color: #FDF5E6;
	border: thin solid gray;
}

/* Attachments table (to be deprecated when attachments are handled differently)*/
table.attachments {
	border-radius: 0px;
	background-color: white;
	border-collapse: collapse;
	margin: 1em 0em;
	font-size: 1em;
}

table.attachments th {
	padding: 0.5em;
}

table.attachments td {
	border-top: 1px solid lightgray;
	border-bottom: 1px solid lightgray;
	padding: 0.5em 1em;

	/* FIXME: This needs to be improved. */
	max-width: 400px;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

table.attachments td+td, table.attachments th+th {
	border-left: 0px;
}

table.attachments td.icon {
	-webkit-user-select: none;
	padding: 0em;
}

table.attachments td.icon img {
	min-width: 16px;
	width: 1.5em;
	height: auto;
}

table.attachments td.description {
	border-left: none;
	padding-left: 5px;
}

table.attachments td.description a:link {
	color: black;
	text-decoration: none;
}

table.attachments td.description a:active {
	color: gray;
}

table.attachments td.description a:hover {
	text-decoration:underline;
}

table.attachments td.description a:visited {
	color: gray;
}

table.attachments td.size {
	text-align: right;
	padding-right: 0;
}

table.attachments td.button {
	padding-right: 0;
}

table.attachments form {
	margin: 0;
}

/* Various spacings between messages and message-elements. */
hr.messagedivider { clear: both; margin-top: 10px; margin-bottom: 10px; }
span.header + div.body { margin-top: 10px }
div.bodypart + div.bodypart { margin-top: 10px;  }

/* Styling the horizontal divider between messages. */
hr.messagedivider {
	border-top: thin solid gray;
	height: 2px;
}

/* Styling quoted segments */
details[open] summary::after { content:"Hide quoted text"; }
details summary::after { content:"Show quoted text"; }

details summary {
	font-size: 0.7em;
	background-color: #EEEEEE;
	margin-bottom: 0.5em;
	padding: 0.2em 0.1em;
}

details summary:focus {
	/*	outline: none; */ /* this also kills keyboard navigation */
}

/*
Security levels:
	ok       signed/encrypted and ok
	error    signed/encrypted and not ok
	unknown  not signed/encrypted
*/
div.security {
	border-style: solid;
	border-width: 1px;
	padding: .5em;
	margin: .5em 0em;
}
div.security[level=ok] {
	border-color: green;
}
div.security[level=error] {
	border-color: red;
}
div.security[level=unknown] {
	border-color: yellow;
}

/* Add a ':' after each header title -- this does not work well with copy/paste */
/*span.header_name:after { content: ": " }*/

/* Headers styling */
div.headers table { 
    border-spacing: 0px;
    border-collapse: separate;
}
td span.header_name {
	padding: 0.5em;
	color: gray;
}
div.headers td:nth-child(1) {
	text-align: right;
	vertical-align: top;
	min-width: 4.5em;
}
td span.header_body {
	color: black;
}

/* Link styling in headers */
div.headers a:link {
	color: black;
	text-decoration: none;
}
div.headers a:active {
	color: gray;
}
div.headers a:hover {
	text-decoration:underline;
}
div.headers a:visited {
	color: black;
}
