/* ==========================================================================
   Technik Webmail — Outlook-style layout on top of Roundcube Elastic
   ========================================================================== */
:root {
	--tk-accent: #0a6cdf;          /* Technik blue */
	--tk-accent-d: #0757b5;
	--tk-accent-soft: #e6f0fd;
	--tk-navy: #1b1f4b;
	--tk-bg: #f3f3f3;              /* app background */
	--tk-pane: #ffffff;
	--tk-line: #e1e1e1;
	--tk-text: #242424;
	--tk-muted: #616161;
	--tk-hover: #f5f5f5;
	--tk-sel: #dbe9fb;
	--tk-top: 44px;
	--tk-rib: 54px;
	--tk-radius: 8px;
	--tk-font: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}
html.dark-mode {
	--tk-accent: #4c9dff; --tk-accent-d: #2f86f5; --tk-accent-soft: #1d2b40;
	--tk-bg: #1f1f1f; --tk-pane: #292929; --tk-line: #3a3a3a; --tk-text: #f0f0f0; --tk-muted: #b0b0b0;
	--tk-hover: #333333; --tk-sel: #23395a;
}
body, .popupmenu, .ui-dialog, input, select, textarea, button { font-family: var(--tk-font) !important; }
body { background: var(--tk-bg) !important; color: var(--tk-text); }

/* ---------- icons (own line icons as CSS masks) ---------- */
.tk-i { display: inline-flex; align-items: center; gap: .45rem; font-style: normal; line-height: 1; }
.tk-i::before {
	content: ""; flex: none; width: 20px; height: 20px; background: currentColor;
	-webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.tk-i-menu    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E"); }
.tk-i-mail    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3.5 6.5 8.5 6 8.5-6'/%3E%3C/svg%3E"); }
.tk-i-people  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8.5' r='3.2'/%3E%3Cpath d='M3.5 19c.6-3.2 2.8-5 5.5-5s4.9 1.8 5.5 5'/%3E%3Ccircle cx='17' cy='9.5' r='2.4'/%3E%3Cpath d='M16 14.2c2.4-.3 4.1 1.2 4.6 3.8'/%3E%3C/svg%3E"); }
.tk-i-gear    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 3.5l1.6 2.2 2.7-.5.8 2.6 2.5 1.2-.9 2.6 1.6 2.2-2.2 1.6.1 2.7-2.7.4-1.2 2.5-2.3-1.4-2.3 1.4-1.2-2.5-2.7-.4.1-2.7-2.2-1.6 1.6-2.2-.9-2.6 2.5-1.2.8-2.6 2.7.5z' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tk-i-compose { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M20 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5'/%3E%3Cpath d='M17.5 3.5l3 3L12 15l-4 1 1-4z'/%3E%3C/svg%3E"); }
.tk-i-chev    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
.tk-i-trash   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 7h16M9 7V4.5h6V7M6.5 7l1 12.5h9l1-12.5M10 11v5M14 11v5'/%3E%3C/svg%3E"); }
.tk-i-archive { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='5' rx='1'/%3E%3Cpath d='M5 9v10h14V9M10 13h4'/%3E%3C/svg%3E"); }
.tk-i-move    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpath d='M10 13h6m-2-2 2 2-2 2'/%3E%3C/svg%3E"); }
.tk-i-junk    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='m6.5 6.5 11 11'/%3E%3C/svg%3E"); }
.tk-i-reply   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7 4 12l5 5'/%3E%3Cpath d='M4 12h9a7 7 0 0 1 7 7'/%3E%3C/svg%3E"); }
.tk-i-replyall{ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7 3 12l5 5M12 7l-5 5 5 5'/%3E%3Cpath d='M7 12h7a7 7 0 0 1 7 7'/%3E%3C/svg%3E"); }
.tk-i-forward { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 7 5 5-5 5'/%3E%3Cpath d='M20 12h-9a7 7 0 0 0-7 7'/%3E%3C/svg%3E"); }
.tk-i-envopen { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3 10 12 4l9 6v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z'/%3E%3Cpath d='m3.5 10.5 8.5 5.5 8.5-5.5'/%3E%3C/svg%3E"); }
.tk-i-flag    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M6 21V4M6 4h11l-2.5 4L17 12H6'/%3E%3C/svg%3E"); }
.tk-i-refresh { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M19 12a7 7 0 1 1-2.1-5'/%3E%3Cpath d='M19 4v4h-4'/%3E%3C/svg%3E"); }
.tk-i-print   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M7 9V4h10v5M7 17H5a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-2'/%3E%3Cpath d='M7 14h10v6H7z'/%3E%3C/svg%3E"); }
.tk-i-more    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='6' cy='12' r='1.6'/%3E%3Ccircle cx='12' cy='12' r='1.6'/%3E%3Ccircle cx='18' cy='12' r='1.6'/%3E%3C/svg%3E"); }
.tk-i-personadd{--ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='10' cy='8.5' r='3.5'/%3E%3Cpath d='M3.5 19.5c.7-3.4 3.2-5.5 6.5-5.5 1.3 0 2.5.3 3.5 1M18 13v6M15 16h6'/%3E%3C/svg%3E"); }
.tk-i-import  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11m-4-4 4 4 4-4M5 19h14'/%3E%3C/svg%3E"); }
.tk-i-export  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4m-4 4 4-4 4 4M5 19h14'/%3E%3C/svg%3E"); }
.tk-i-sign    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 17c3-6 5-9 6-8s-3 8-1 8 3-4 4-4 0 4 2 4 3-2 5-2'/%3E%3Cpath d='M4 21h16'/%3E%3C/svg%3E"); }
.tk-i-rules   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 6h10M4 12h7M4 18h10'/%3E%3Cpath d='m16 10 2 2 3-4'/%3E%3C/svg%3E"); }
.tk-i-away    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.tk-i-logout  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4M10 16l4-4-4-4M14 12H4'/%3E%3C/svg%3E"); }
.tk-i-moon    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z'/%3E%3C/svg%3E"); }
.tk-i-pane    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M10 5v14'/%3E%3C/svg%3E"); }
.tk-i-sort    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4v16m-3-3 3 3 3-3M16 20V4m-3 3 3-3 3 3'/%3E%3C/svg%3E"); }
.tk-i-filter  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 7h16M7 12h10M10 17h4'/%3E%3C/svg%3E"); }
.tk-i-density { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 10h16M4 14h16M4 18h16'/%3E%3C/svg%3E"); }
.tk-i-info    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E"); }
.tk-i-help    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M9.6 9.5a2.5 2.5 0 1 1 3.4 2.3c-.6.3-1 .8-1 1.5v.4M12 17h.01'/%3E%3C/svg%3E"); }
.tk-i-folder  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
.tk-i-search  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='m15 15 5 5'/%3E%3C/svg%3E"); }
.tk-i-send    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M4 12 20 4l-4 16-4-7z'/%3E%3Cpath d='m12 13 8-9'/%3E%3C/svg%3E"); }

/* ---------- top bar ---------- */
#tk-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; background: var(--tk-bg); }
.tk-row { height: var(--tk-top); display: flex; align-items: center; gap: .3rem; padding: 0 .6rem; }
.tk-iconbtn { width: 38px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--tk-text) !important; }
.tk-iconbtn:hover { background: var(--tk-hover); }
.tk-brand { width: 22px; height: 22px; margin: 0 .5rem 0 .2rem; }
html.dark-mode .tk-brand { content: url("../images/technik-mark-light.svg"); }
.tk-tabs { display: flex; gap: .1rem; }
.tk-tab { border: 0; background: none; padding: .45rem .8rem; font-size: 14px; color: var(--tk-text); border-radius: 6px; position: relative; cursor: pointer; }
.tk-tab:hover { background: var(--tk-hover); }
.tk-tab.on { font-weight: 600; }
.tk-tab.on::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 1px; height: 3px; border-radius: 3px; background: var(--tk-accent); }
.tk-search-slot { flex: 1; display: flex; justify-content: center; min-width: 0; padding: 0 1rem; }
.tk-search-slot .searchbar { width: min(560px, 100%); margin: 0 !important; border: 1px solid var(--tk-line) !important; background: var(--tk-pane) !important; border-radius: 6px !important; height: 32px; }
.tk-search-slot .searchbar input { background: transparent !important; color: var(--tk-text) !important; height: 30px !important; }
.tk-apps { display: flex; align-items: center; gap: .15rem; }
.tk-app { width: 36px; height: 34px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 6px; color: var(--tk-muted) !important; }
.tk-app:hover { background: var(--tk-hover); color: var(--tk-text) !important; }
.tk-app.on { color: var(--tk-accent) !important; background: var(--tk-accent-soft); }
.tk-app .tk-i { font-size: 0; }
.tk-me { margin-left: .4rem; }
.tk-me-av { width: 30px !important; height: 30px !important; font-size: 12px !important; margin: 0 !important; float: none !important; }

/* ribbon */
.tk-ribbon { margin: 0 .55rem; background: var(--tk-pane); border-radius: var(--tk-radius); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 1px rgba(0,0,0,.1); height: calc(var(--tk-rib) - 8px); }
.tk-pane { display: none; align-items: center; height: 100%; padding: 0 .4rem; gap: .1rem; overflow-x: auto; white-space: nowrap; }
.tk-pane.on { display: flex; }
.tk-rb { display: inline-flex !important; align-items: center; justify-content: center; gap: .4rem; height: 34px; min-width: 36px; padding: 0 .45rem; border-radius: 6px; color: var(--tk-text) !important; text-decoration: none !important; font-size: 14px; }
.tk-rb:hover { background: var(--tk-hover); }
.tk-rb.disabled, .tk-rb[aria-disabled="true"] { opacity: .38; pointer-events: none; }
.tk-rb .tk-i-trash::before, .tk-rb .tk-i-junk::before { color: #c4314b; background: #c4314b; }
.tk-rb .tk-i-archive::before { background: #13a10e; }
.tk-rb .tk-i-reply::before, .tk-rb .tk-i-replyall::before { background: #b146c2; }
.tk-rb .tk-i-forward::before, .tk-rb .tk-i-move::before { background: var(--tk-accent); }
.tk-rb .tk-i-flag::before { background: #c4314b; }
.tk-sep { width: 1px; height: 24px; background: var(--tk-line); margin: 0 .35rem; flex: none; }
.tk-hint { color: var(--tk-muted); font-size: 13px; margin-left: .6rem; }
.tk-split { display: inline-flex; align-items: stretch; height: 34px; border-radius: 6px; overflow: hidden; background: var(--tk-accent); margin-right: .2rem; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.tk-new, .tk-new-more { display: inline-flex; align-items: center; gap: .45rem; color: #fff !important; text-decoration: none !important; font-weight: 600; font-size: 14px; }
.tk-new { padding: 0 .9rem 0 .7rem; }
.tk-new-more { padding: 0 .35rem; border-left: 1px solid rgba(255,255,255,.35); }
.tk-new:hover, .tk-new-more:hover { background: var(--tk-accent-d); }
.tk-dropmenu { position: fixed; z-index: 60; min-width: 210px; background: var(--tk-pane); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: .3rem; }
.tk-dropmenu a { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 6px; color: var(--tk-text) !important; text-decoration: none !important; font-size: 14px; }
.tk-dropmenu a:hover { background: var(--tk-hover); }

/* ---------- app layout under the top bar ---------- */
@media (min-width: 769px) {
	body:not(.task-login) #layout { position: fixed; top: calc(var(--tk-top) + var(--tk-rib)); left: 0; right: 0; bottom: 0; height: auto !important; padding: 0 .55rem .55rem; gap: .55rem; background: var(--tk-bg); }
	body:not(.task-login) #layout-menu { display: none !important; }
	#layout-sidebar { background: transparent !important; border: 0 !important; width: 250px; min-width: 200px; }
	#layout-sidebar .header, #layout-list .header, #layout-content .header { background: transparent !important; border: 0 !important; }
	#layout-list, #layout-content { background: var(--tk-pane) !important; border: 0 !important; border-radius: var(--tk-radius); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 1px rgba(0,0,0,.1); overflow: hidden; }
	#layout-list { min-width: 340px; }
	#layout-sidebar #folderlist-content, #layout-sidebar .scroller { background: transparent !important; }
	body.tk-nofolders #layout-sidebar { display: none !important; }
	body.tk-noreading.task-mail #layout-content { display: none !important; }
	body.tk-noreading.task-mail #layout-list { flex: 1; max-width: none; }
}
@media (max-width: 768px) {
	.tk-ribbon, .tk-tabs, .tk-search-slot, .tk-apps .tk-app { display: none !important; }
	body:not(.task-login) #layout { position: fixed; top: var(--tk-top); left: 0; right: 0; bottom: 0; height: auto !important; }
}
#layout-sidebar .header .header-title.username { font-weight: 600; color: var(--tk-text); }

/* ---------- folder pane ---------- */
.tk-favs { margin: .2rem .25rem .6rem; }
.tk-sec { display: flex; align-items: center; gap: .35rem; padding: .45rem .6rem; font-weight: 600; font-size: 14px; color: var(--tk-text); cursor: pointer; user-select: none; border-radius: 6px; }
.tk-sec:hover { background: var(--tk-hover); }
.tk-sec .tk-i-chev::before { width: 16px; height: 16px; transition: transform .15s; }
.tk-sec.closed .tk-i-chev::before { transform: rotate(-90deg); }
.tk-favs.closed .tk-favlist, .tk-acct.closed + #folderlist-content { display: none; }
.tk-favlist a { display: flex; align-items: center; gap: .6rem; padding: .48rem .6rem .48rem 1.9rem; border-radius: 6px; color: var(--tk-text) !important; text-decoration: none !important; font-size: 14px; }
.tk-favlist a:hover { background: var(--tk-hover); }
.tk-favlist a.on { background: var(--tk-sel); font-weight: 600; }
.tk-favlist .cnt { margin-left: auto; color: var(--tk-accent); font-weight: 600; font-size: 13px; }
#mailboxlist li > a { border-radius: 6px; margin: 1px .25rem; color: var(--tk-text) !important; font-size: 14px; }
#mailboxlist li > a:hover { background: var(--tk-hover) !important; }
#mailboxlist li.selected > a { background: var(--tk-sel) !important; font-weight: 600; color: var(--tk-text) !important; }
#mailboxlist li.unread > a .unreadcount, #mailboxlist .unreadcount { background: transparent !important; color: var(--tk-accent) !important; font-weight: 600 !important; }
#mailboxlist li > a:before, .tk-favlist a:before { color: var(--tk-muted) !important; }
#layout-sidebar .footer { background: transparent !important; border: 0 !important; }

/* ---------- message list ---------- */
#layout-list .header { min-height: 52px; }
.tk-listtabs { display: flex; align-items: center; gap: .2rem; margin-right: auto; padding-left: .3rem; }
.tk-listtab { border: 0; background: none; padding: .55rem .7rem; font-size: 15px; color: var(--tk-muted); position: relative; cursor: pointer; border-radius: 6px; }
.tk-listtab:hover { background: var(--tk-hover); }
.tk-listtab.on { color: var(--tk-text); font-weight: 600; }
.tk-listtab.on::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: 2px; height: 3px; border-radius: 3px; background: var(--tk-accent); }
#messagelist tbody tr td { border-bottom: 1px solid var(--tk-line) !important; background: var(--tk-pane); }
#messagelist tbody tr:hover td { background: var(--tk-hover) !important; }
#messagelist tbody tr.selected td, #messagelist tbody tr.focused.selected td { background: var(--tk-sel) !important; }
#messagelist tbody tr.unread td:first-child { box-shadow: inset 4px 0 0 var(--tk-accent); }
#messagelist tr.unread .fromto, #messagelist tr.unread .fromto span { font-weight: 700 !important; color: var(--tk-text) !important; }
#messagelist tr.unread .subject a, #messagelist tr.unread span.subject a, #messagelist tr.unread .date { color: var(--tk-accent) !important; font-weight: 600; }
#messagelist td.subject { padding-top: .55rem !important; padding-bottom: .55rem !important; }
#messagelist .fromto { font-size: 14px; color: var(--tk-text); }
#messagelist span.subject a { font-size: 13.5px; }
.tk-avatar {
	float: left; width: 36px; height: 36px; border-radius: 50%; margin: .1rem .8rem 0 .1rem;
	display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; letter-spacing: .02em;
	background: #e8d6f0; color: #6b2c86;
}
.tk-group {
	display: flex; align-items: center; gap: .45rem; margin: -.55rem -10rem .55rem -3.4rem; padding: .55rem 10rem .55rem 3.4rem;
	background: var(--tk-bg); color: var(--tk-text); font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--tk-line); pointer-events: none;
}
.tk-group::before { content: ""; width: 14px; height: 14px; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") center/contain no-repeat; }
#messagelist td.subject { overflow: visible !important; }
#messagelist { table-layout: fixed; }
body.tk-compact #messagelist td.subject { padding-top: .3rem !important; padding-bottom: .3rem !important; }
body.tk-compact .tk-avatar { display: none; }

/* ---------- reading pane (preview frame) ---------- */
html.iframe body.action-preview, html.iframe body.action-show { background: var(--tk-pane) !important; }
body.action-preview #layout-content, body.action-show #layout-content { background: var(--tk-pane) !important; }
#message-header { padding: 1.1rem 1.4rem .6rem !important; border-bottom: 0 !important; }
#message-header > .subject, #message-header h2.subject { font-size: 22px !important; font-weight: 600 !important; color: var(--tk-text) !important; margin-bottom: .9rem !important; }
#message-header .header { display: flex; align-items: flex-start; }
#message-header .header-content .header-summary .sender a, #message-header .header .from a, #message-header .header .from { color: var(--tk-accent) !important; font-weight: 600; font-size: 15px; }
#message-header .tk-avatar { width: 46px; height: 46px; font-size: 16px; margin-right: 1rem; }
#messagebody, #message-objects { padding: .4rem 1.4rem 1.4rem 4.4rem !important; }
.message-partheaders, .message-htmlpart, .message-part { border: 0 !important; }

/* ---------- compose ---------- */
body.action-compose #layout-content { background: var(--tk-pane) !important; }
body.action-compose #layout-content .header { border-bottom: 1px solid var(--tk-line) !important; }
body.action-compose .btn-primary.send, body.action-compose button.send, body.action-compose a.send {
	background: var(--tk-accent) !important; border-color: var(--tk-accent) !important; color: #fff !important; border-radius: 6px !important; font-weight: 600 !important;
}
body.action-compose #compose-headers .form-group > label.col-form-label,
body.action-compose #compose-headers .form-group > .col-form-label {
	flex: 0 0 auto; max-width: none; width: auto; min-width: 64px; margin: .25rem .8rem .25rem 0; padding: .35rem .8rem;
	border: 1px solid var(--tk-line); border-radius: 6px; text-align: center; font-weight: 600; font-size: 13.5px; color: var(--tk-text);
}
body.action-compose #compose-headers .form-group { border-bottom: 1px solid var(--tk-line); margin: 0; padding: .35rem 0; align-items: center; }
body.action-compose #compose-headers .form-control, body.action-compose #compose-headers .recipient-input { border: 0 !important; box-shadow: none !important; background: transparent !important; }
body.action-compose #compose-subject { font-size: 15px; }
body.action-compose .tox-tinymce { border: 0 !important; }
body.action-compose .tox .tox-toolbar, body.action-compose .tox .tox-toolbar__primary { background: var(--tk-pane) !important; }

/* ---------- buttons & general ---------- */
.btn-primary { background-color: var(--tk-accent) !important; border-color: var(--tk-accent) !important; border-radius: 6px !important; }
.btn-primary:hover { background-color: var(--tk-accent-d) !important; border-color: var(--tk-accent-d) !important; }
a { color: var(--tk-accent); }
.popupmenu, .popover { border-radius: 8px !important; border: 0 !important; box-shadow: 0 8px 24px rgba(0,0,0,.18) !important; }

/* ---------- login ---------- */
body.task-login { background: #f3f3f3 !important; }
html.dark-mode body.task-login { background: #1b1b1b !important; }
body.task-login #layout { background: transparent !important; }
.tk-login { display: flex !important; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; background: transparent !important; }
.tk-login-card { width: min(440px, 92vw); background: #fff; padding: 2.6rem 2.6rem 2rem; box-shadow: 0 2px 6px rgba(0,0,0,.2); border-radius: 4px; }
html.dark-mode .tk-login-card { background: #2b2b2b; }
.tk-login-logo { display: block; height: 42px; width: auto; margin-bottom: 1.6rem; }
.tk-only-dark { display: none; }
html.dark-mode .tk-only-dark { display: block; } html.dark-mode .tk-only-light { display: none; }
.tk-login-title { font-size: 24px; font-weight: 600; margin: 0 0 .2rem; color: var(--tk-text); }
.tk-login-sub { color: var(--tk-muted); margin: 0 0 1.3rem; font-size: 14px; }
.tk-login #login-form { background: transparent !important; box-shadow: none !important; padding: 0 !important; width: 100% !important; max-width: none !important; }
.tk-login #login-form table, .tk-login #login-form tbody, .tk-login #login-form tr { display: block; width: 100%; }
.tk-login #login-form td.title { display: none; }
.tk-login #login-form td.input { display: block; width: 100%; padding: 0 0 .9rem; }
.tk-login #login-form .input-group-prepend, .tk-login #login-form .input-group-text { display: none !important; }
.tk-login #login-form input.form-control {
	border: 0 !important; border-bottom: 1px solid #8a8886 !important; border-radius: 0 !important; padding: .55rem .1rem !important;
	background: transparent !important; box-shadow: none !important; font-size: 15px; color: var(--tk-text) !important; width: 100%;
}
.tk-login #login-form input.form-control:focus { border-bottom: 2px solid var(--tk-accent) !important; }
.tk-login #login-form .formbuttons { display: flex; justify-content: flex-end; margin-top: 1.2rem; }
.tk-login #login-form .formbuttons .btn, .tk-login #login-form button.mainaction {
	min-width: 120px; padding: .5rem 1.4rem !important; border-radius: 2px !important; background: var(--tk-accent) !important; border: 0 !important; font-weight: 600 !important; font-size: 15px;
}
.tk-login-help { margin: 1.4rem 0 0; font-size: 13px; color: var(--tk-muted); }
.tk-login-foot { margin-top: 1.4rem; font-size: 12.5px; color: var(--tk-muted); }
.tk-login #logo, body.task-login #login-footer { display: none !important; }

/* ===== v2 fixes ===== */
/* ribbon: icon-only buttons hide their text; wide buttons keep it */
.tk-rb:not(.tk-wide) .tk-i { font-size: 0; gap: 0; }
.tk-rb.tk-wide .tk-i { font-size: 14px; }
/* folder pane: account name lives in the account header */
@media (min-width: 769px) { #layout-sidebar > .header { display: none !important; } }
.tk-favs { margin-top: .5rem; }
/* message list header: only our tabs + compact icon tools */
#messagelist-header .header-title { display: none !important; }
#messagelist-header .toolbar a span.inner { display: none !important; }
#messagelist-header .toolbar a { min-width: 34px !important; padding: 0 .3rem !important; }
#messagelist-header .toolbar a.threads, #messagelist-header .toolbar a.select { display: none !important; }
.tk-listtabs { flex: 1; min-width: 0; overflow: hidden; }
/* message rows: avatar column + full-width group band */
#messagelist td.subject { position: relative; padding-left: 3.7rem !important; }
#messagelist td.subject .tk-avatar { position: absolute; left: .7rem; top: .65rem; margin: 0; float: none; }
#messagelist td.subject.tk-hasgroup .tk-avatar { top: calc(.65rem + 38px); }
.tk-group { flex: 0 0 calc(100% + 13.5rem) !important; width: calc(100% + 13.5rem); margin: -.55rem -10rem .55rem -3.7rem !important; padding: .5rem 10rem .5rem 1.2rem !important; box-sizing: border-box; height: 38px; }
body.tk-compact #messagelist td.subject { padding-left: 1rem !important; }
/* login */
body.task-login #layout-content, body.task-login #layout { background: transparent !important; box-shadow: none !important; border-radius: 0 !important; }
.tk-login { text-align: left !important; padding: 0 !important; }
.tk-login-card { text-align: left; }
.tk-login #login-form table, .tk-login #login-form tbody { display: table !important; width: 100% !important; margin: 0 !important; }
.tk-login #login-form tr { display: table-row !important; }
.tk-login #login-form td.input { display: table-cell !important; width: 100% !important; padding: 0 0 1rem !important; }
.tk-login #login-form .formbuttons { position: static !important; display: flex !important; justify-content: flex-end; margin: .6rem 0 0 !important; padding: 0 !important; width: 100% !important; }
.tk-login #login-form .formbuttons .btn, .tk-login #login-form button.mainaction { width: auto !important; text-transform: none !important; letter-spacing: 0 !important; }
.tk-login-title, .tk-login-sub { text-align: left; }

/* v3: Elastic positions #login-form with top:180px */
.tk-login #login-form { position: static !important; top: auto !important; bottom: auto !important; }
.tk-login #login-form td.input { display: block !important; }
.tk-login #login-form tr.form-group { margin: 0 !important; }

/* v4: compose ribbon + polish */
.tk-i-save   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M5 4h11l3 3v13H5z'/%3E%3Cpath d='M8 4v5h7V4M8 20v-6h8v6'/%3E%3C/svg%3E"); }
.tk-i-attach { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M20 11.5 12.2 19.3a5 5 0 0 1-7-7L13 4.5a3.4 3.4 0 0 1 4.8 4.8l-7.7 7.7a1.7 1.7 0 0 1-2.4-2.4L14.8 7.5'/%3E%3C/svg%3E"); }
/* Elastic's own sender photo duplicates our avatar */
#message-header .contactphoto, #message-header .header-content > .contactphoto { display: none !important; }
/* list header: icon-only refresh */
#messagelist-header a.refresh span.inner, #layout-list .header a.refresh .inner { display: none !important; }
/* compose: Outlook-like single column, options as a slim side panel */
body.action-compose #layout-sidebar { width: 300px !important; min-width: 300px !important; max-width: 300px !important; }
body.action-compose #compose-attachments .upload-form, body.action-compose #compose-attachments .hint { font-size: 12px; }
body.action-compose #compose-attachments { min-height: 0 !important; }
body.action-compose.tk-noopts #layout-sidebar { display: none !important; }
body.action-compose #layout-content > .header #messagetoolbar,
body.action-compose #layout-content > .header .toolbar.menu { display: none !important; }
body.action-compose #compose-content { max-width: 1100px; }

/* v5: flat tabs, clean list header, top-right spacing, profile menu, folder pane, add-account */
#tk-topbar .tk-tab, #tk-topbar .tk-tab:hover, #tk-topbar .tk-tab:focus, #tk-topbar .tk-tab:active { background: transparent !important; background-image: none !important; box-shadow: none !important; border: 0 !important; outline: 0; }
#tk-topbar .tk-tab { padding: .45rem .75rem !important; border-radius: 0 !important; color: var(--tk-muted) !important; }
#tk-topbar .tk-tab:hover, #tk-topbar .tk-tab.on { color: var(--tk-text) !important; }
#tk-topbar .tk-tab.on::after { left: .75rem; right: .75rem; bottom: 0; height: 2px; }
.tk-apps { gap: .35rem; padding-left: .5rem; }
.tk-app { width: 34px; height: 34px; }
.tk-me { margin-left: .5rem; display: inline-flex; align-items: center; border-radius: 50%; padding: 2px; text-decoration: none !important; cursor: pointer; }
.tk-me:hover, .tk-me:focus-visible { box-shadow: 0 0 0 2px var(--tk-accent); }
.tk-memenu { min-width: 260px; padding: .4rem; }
.tk-me-card { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem .7rem; border-bottom: 1px solid var(--tk-line); margin-bottom: .3rem; }
.tk-me-card b { display: block; font-size: 14px; color: var(--tk-text); word-break: break-all; }
.tk-me-card small { color: var(--tk-muted); font-size: 12px; }
.tk-me-av2 { width: 40px !important; height: 40px !important; font-size: 15px !important; margin: 0 !important; float: none !important; flex: none; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 50%; }
.tk-memenu a.tk-me-logout { border-top: 1px solid var(--tk-line); margin-top: .3rem; border-radius: 0 0 6px 6px; }
.tk-memenu a.tk-me-logout .inner { display: inline; }

/* message list header: only Alles / Ongelezen / Gemarkeerd */
#layout-list > .header a.refresh, #layout-list > .header a.options, #layout-list > .header .toolbar-button, #layout-list > .header .toolbar, #messagelist-header .header-title { display: none !important; }
#layout-list > .header { display: flex !important; align-items: center; min-height: 48px; }
.tk-listtabs { flex: 1; }

/* folder pane: same look as the favourites */
#mailboxlist, #mailboxlist ul { background: transparent !important; }
#mailboxlist li, #mailboxlist li.selected, #mailboxlist li:hover { border: 0 !important; background: transparent !important; box-shadow: none !important; }
#mailboxlist li > a { display: flex !important; align-items: center; padding: .48rem .6rem .48rem 1.9rem !important; margin: 0 !important; line-height: 1.25 !important; height: auto !important; border: 0 !important; position: relative; }
#mailboxlist li > a:before { position: absolute !important; left: .5rem !important; top: 50% !important; transform: translateY(-50%); font-size: 13px !important; width: 1.1rem !important; margin: 0 !important; line-height: 1 !important; text-align: center; }
#mailboxlist li.selected > a { box-shadow: none !important; }
#mailboxlist li ul li > a { padding-left: 2.9rem !important; }
#mailboxlist li ul li > a:before { left: 1.5rem !important; }
#mailboxlist li div.treetoggle { left: auto !important; right: .4rem; top: .5rem !important; }
#mailboxlist li .unreadcount { margin-left: auto; position: static !important; }
#layout-sidebar .tk-acct { margin-top: .35rem; }

/* bottom of the folder pane: add account */
.tk-addacct-bar { display: flex; align-items: center; gap: .6rem; margin: .4rem .25rem .2rem; padding: .55rem .7rem; border-radius: 6px; border: 1px dashed var(--tk-line); color: var(--tk-text) !important; font-size: 14px; text-decoration: none !important; cursor: pointer; background: transparent; box-sizing: border-box; width: calc(100% - .5rem); font-family: var(--tk-font); }
.tk-addacct-bar:hover { background: var(--tk-hover); border-color: var(--tk-accent); color: var(--tk-accent) !important; }

/* add-account popup */
.tk-modal-bg { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.tk-modal { width: min(460px, 100%); background: var(--tk-pane); color: var(--tk-text); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; font-family: var(--tk-font); }
.tk-modal-h { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem .4rem; }
.tk-modal-h h2 { margin: 0; font-size: 19px; font-weight: 600; color: var(--tk-text); }
.tk-modal-x { border: 0 !important; background: transparent !important; color: var(--tk-muted) !important; font-size: 22px; line-height: 1; cursor: pointer; border-radius: 6px; width: 32px; height: 32px; padding: 0 !important; }
.tk-modal-x:hover { background: var(--tk-hover) !important; color: var(--tk-text) !important; }
.tk-modal-tabs { display: flex; gap: 1.2rem; padding: 0 1.3rem; border-bottom: 1px solid var(--tk-line); }
.tk-modal-tabs button { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: .65rem 0 !important; font-size: 14px; color: var(--tk-muted) !important; cursor: pointer; position: relative; border-radius: 0 !important; }
.tk-modal-tabs button.on { color: var(--tk-text) !important; font-weight: 600; }
.tk-modal-tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--tk-accent); border-radius: 2px; }
.tk-modal-b { padding: 1.1rem 1.3rem 1.3rem; }
.tk-m-sub { margin: 0 0 1rem; color: var(--tk-muted); font-size: 13px; line-height: 1.45; }
.tk-modal label.tk-f { display: block; font-size: 13px; color: var(--tk-muted); margin-bottom: .8rem; font-weight: normal; }
.tk-modal label.tk-f input { display: block; width: 100%; margin-top: .3rem; height: 36px; padding: 0 .7rem; font-size: 14px; color: var(--tk-text) !important; background: var(--tk-pane) !important; border: 1px solid var(--tk-line); border-bottom: 2px solid var(--tk-line); border-radius: 4px; box-sizing: border-box; box-shadow: none !important; }
.tk-modal label.tk-f input:focus { outline: 0; border-bottom-color: var(--tk-accent); }
.tk-addr { display: flex; align-items: stretch; margin-top: .3rem; }
.tk-modal .tk-addr input { margin-top: 0 !important; border-radius: 4px 0 0 4px !important; min-width: 0; }
.tk-addr span { height: 36px; display: inline-flex; align-items: center; padding: 0 .7rem; background: var(--tk-hover); border: 1px solid var(--tk-line); border-left: 0; border-radius: 0 4px 4px 0; color: var(--tk-text); font-size: 14px; white-space: nowrap; box-sizing: border-box; }
.tk-m-err { margin: 0 0 .9rem; padding: .6rem .75rem; border-radius: 6px; background: rgba(196,49,75,.12); color: #c4314b; font-size: 13px; }
html.dark-mode .tk-m-err { color: #ff8a9b; }
.tk-m-ok { margin: 0 0 .9rem; padding: .6rem .75rem; border-radius: 6px; background: rgba(19,161,14,.14); color: #13a10e; font-size: 13px; }
html.dark-mode .tk-m-ok { color: #6ccb5f; }
.tk-m-info { font-size: 12.5px; color: var(--tk-muted); margin: -.2rem 0 1rem; }
.tk-m-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
.tk-btn { height: 34px; padding: 0 1rem !important; border-radius: 4px !important; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--tk-line) !important; background: var(--tk-pane) !important; color: var(--tk-text) !important; }
.tk-btn:hover { background: var(--tk-hover) !important; }
.tk-btn.pri { background: var(--tk-accent) !important; border-color: var(--tk-accent) !important; color: #fff !important; }
.tk-btn.pri:hover { background: var(--tk-accent-d) !important; }
.tk-btn[disabled] { opacity: .55; cursor: default; }
.tk-m-none { padding: .8rem; border-radius: 6px; background: var(--tk-hover); color: var(--tk-muted); font-size: 13px; line-height: 1.45; }
